common.js 273 Bytes
export let getApiName = str => {
  return str.substr(str.lastIndexOf('/') + 1, str.length)
}

export let createApiObj = ((apiPathArr, PROJECT_ROOT = '') => {
  let obj = {};
  apiPathArr.forEach(item => {
    obj[getApiName(item)] = PROJECT_ROOT + item
  })
  return obj
})