Navigation Menu

Skip to content

patrickleet/expand-keys

Repository files navigation

expand-keys

Release codecov

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)
  })
})