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