You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

unflatten

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

unflatten

The opposite of `flatten`


Version published
Maintainers
2
Created

Readme

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc