Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
/ expand-keys Public archive
forked from patrickleet/expand-keys

expands object's keys with dots to nested objects

Notifications You must be signed in to change notification settings

418sec/expand-keys

 
 

Repository files navigation

expand-keys

Build Status codecov Greenkeeper badge

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

About

expands object's keys with dots to nested objects

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%