Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nestify-anything

mesqueeb8.4kMIT3.0.3TypeScript support: included

Recreates an object from any nested.props. A simple and small integration.

nestify, nest-objects, nestify-objects, nested, paths, nest-paths

readme

Nestify anything 🧅

Total Downloads Latest Stable Version

npm i nestify-anything

Recreates an object from any nested.props. A simple and small integration.

Can be used in combination with flatten-anything 🏏, which does the exact opposite of this one! 😉

Meet the family (more tiny utils with TS support)

Usage

import { nestifyObject } from 'nestify-anything'

const target = {
  'name': 'Ho-oh',
  'types.fire': true,
  'types.flying': true,
}

nestifyObject(target)
// returns {
//   name: 'Ho-oh',
//   types: { fire: true, flying: true }
// }

Currently the library only works with the dot character '.' as separator. If you need other characters like slash '/', let me know in an issue!