🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

unflatten

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unflatten

The opposite of `flatten`

1.0.4
latest
Source
npm
Version published
Weekly downloads
1.4K
-1.93%
Maintainers
2
Weekly downloads
 
Created
Source

unflatten

Build Status js-standard-style npm version Coverage Status

var obj = unflatten(subject, [opts])

Opposite of flatten-obj. Unflattens an object with delimited keys

  • subject (object) - Object that needs to be unflattened

  • [opts] (object|string|boolean) - Optional.

    • Provide a string as a shortcut for { separator: opts }
    • Provide a boolean as a shorcut for { objectMode: opts }
    • Provide an object to set both options { separator: '/', objectMode: true }
  • Available options:

  • separator (string) - defaults to '.'

  • objectMode (boolean) - defaults to false

  • return (object) obj - Nested Javascript object
const unflatten = require('unflatten')
unflatten({
  'a.b.c': 'd'
})
/*
{
  a: {
    b: {
      c: 'd'
    }
  }
}
*/

Keywords

flatten

FAQs

Package last updated on 13 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts