expand-keys
v1.0.4
Published
expands object's keys with dots (like.this) to nested objects { like: this: {} }
Downloads
9
Readme
expand-keys
describe('expandKeys', () => {
it('expands keys', () => {
let expected = {
hello: {
world: 1,
galaxy: 2
},
three: {
dots: {
deep: {
son: {
wow: true
}
}
}
}
}
let expanded = expandKeys({
'hello.world': 1,
'hello.galaxy': 2,
'three.dots.deep.son': { wow: true }
})
expect(expanded).toEqual(expected)
})
})