deep-objectify
TypeScript icon, indicating that this package has built-in type declarations

1.0.13 • Public • Published

deep-objectify

Build Status version dependencies devDependencies

Curly brackets all the way down

This is a tiny JS utility that converts deeply nested structures, which may include layers of objects and arrays, to pure nested objects. The key feature is converting arrays to objects. While objects and arrays are more or less equivalent in JS, it may be easier to reason about complicated data processing and storage if you can guaranteee that your complex JSON object has values that are stricly primitives or child JSON objects.

TypeScript definitions included!

Installation

npm install deep-objectify

Usage

var objectify = require('deep-objectify');

objectify({foo: 'bar', x: ['a', 'b']}); // -> {foo: 'bar', x: {'0': 'a', '1': 'b'}}

See also deepObjectifyTests.ts.

Package Sidebar

Install

npm i deep-objectify

Weekly Downloads

0

Version

1.0.13

License

SEE LICENSE IN LICENSE

Unpacked Size

8.67 kB

Total Files

7

Last publish

Collaborators

  • dabh