New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsonarray_minimizer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonarray_minimizer

it minimize the size of json object or array by removing invalid values like undefined, null, empty array [] and empty json object {}

  • 0.1.7
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

JSON or Array minimizer

It minimize the size of json object or array by removing invalid values like undefined, null, empty array [] and empty json object {} and return the new filtered JSONObject or array

Installation

npm install jsonarray_minimizer

Banefit

It minimize the size of json object or array by removing invalid values like undefined, null, empty array []
and empty json object {} AND RETURN THE NEW FILTERED JSONOBEJCT OR ARRAY

Usage

var ja_minimizer = require('jsonarray_minimizer');

var object = {
    a:{a:"abc", b:{}, c:{a:"a", b:{a:{a:{a:null,b:undefined,c:{},d:"d"}}}}},
    b:[1,2,"",null],
    c:"nafis",
    d:null,
    e:undefined,
    f:"",
    g:[[],{}],
    h:"",
    i:null,
    j:"nafis ahmed",
    k:["abc",null,[],{},["a","b"],undefined],
    l:{
        a:["av"],
        b:{
            "hi":{}
        },
        c:{},
        d:{
            a:"a"
        },
        e:[undefined]

    }

}
var output = ja_minimizer(object);
console.log(output);

Output

output :

{
    "a":{"a":"abc","c":{"a":"a","b":{"a":{"a":{"d":"d"}}}}},
    "b":[1,2],
    "c":"nafis",
    "j":"nafis ahmed",
    "k":["abc",["a","b"]],
    "l":{"a":["av"],"d":{"a":"a"}}
}

Contributing

I have built this code for saving storage and minimize scrap in the data.

FAQs

Package last updated on 06 Oct 2017

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc