1.0.6 • Published 6 years ago

normalize-icafe-pkg v1.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

normalize-icafe-pkg

规范 icafe 字段

Icafe 字段在 package.json 中的标准

简洁写法(直接在 icafe 或者 new-icafe 字段赋 spaceId)
{
  "icafe": "icafe-api"
}
复杂写法(规范写法,在 icafe 或者 new-icafe 字段书写完整值)
{
  "icafe": {
    "spaceId": "icafe-api",
    "username": "yucong02",
    "password": "..."
  }
}

Usage

const { normalizeIcafeByPkg, normalizeIcafe } = require('normalize-icafe-pkg');

normalizeIcafe('ok') //  { spaceId: 'ok' }
normalizeIcafe({ spaceId: 'ok', username: 'uu' }) //  { spaceId: 'ok', username: 'uu' }

normalizeIcafeByPkg({
  icafe: 'normalizeIcafeByPkg'
}) // { spaceId: 'normalizeIcafeByPkg' }

normalizeIcafeByPkg({
  icafe: { spaceId: 'normalizeIcafeByPkg', username: 'yucong02' }
}) // { spaceId: 'normalizeIcafeByPkg', username: 'yucong02' }