0.1.7 • Published 7 years ago

jsonarray_minimizer v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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.

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

7 years ago