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

deep-objectify

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
d

deep-objectify

A simple utility for converting a deep JSON structure to pure nested objects

1.0.13
latest
69

Supply Chain Security

100

Vulnerability

71

Quality

76

Maintenance

100

License

Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Issues
2

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.

FAQs

Package last updated on 26 Nov 2022

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