replace-empty-objects
v2.0.0
Published
Recursively replace empty objects with null
Downloads
2
Readme
replace-empty-objects
Recursively replace empty objects with null
install
npm install replace-empty-objects
usage
var replaceEmptyObjects = require('replace-empty-objects');
var obj = {
a : {
b : {}
, c : {}
, d : {}
}
, b : {}
};
replaceEmptyObjects(obj);
console.log(obj);
/*
{
a : {
b : null
, c : null
, d : null
}
, b : null
}
*/
license
MIT