fix-obj
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published
  1. 对象子结构 subObj.
const obj = {
  nice: {
    good: {
      better: '',
      worse: ''
    },
    bad: { }
  }
}
 
const b = {
  nice: {
    good: {
      better: ''
    }
  }
}
  1. 同key映射.
const a = {
  text: 'liu',
  type: 'big',
}
const b = {
  text: '',
  type: 'big'
}
  1. 对象转置/数组转置.
// 3. 对象转置/数组转置.
const a = [
  {
    id: '11',
    name: 'nihao'
  },
  {
    id: '12',
    name: 'dalao'
  }
]
 
const b = {
  id: ['11', '12'],
  name: ['nihao', 'dalao']
}
 
  1. 状态路径选择.
// 例如用于构建权限的映射表的配置数据.
const config  = {
  attendee : {
    inMeeting: [0, 1]
    endMeeting: [0, 3],
  },
  compere: {
    inMeeting: [0, 1]
    endMeeting: [1, 1],
  }
}

Readme

Keywords

Package Sidebar

Install

npm i fix-obj

Weekly Downloads

1

Version

1.0.10

License

MIT

Unpacked Size

38.2 kB

Total Files

64

Last publish

Collaborators

  • eoyo