clean-object
v1.0.2
Published
Recursively delete properties from an object that have values of {} or undefined
Downloads
2,137
Readme
clean-object
Recursively delete properties from an object that have values of {}, or undefined
Usage
var cleanObject = require('clean-object');
var object = {
a: 1,
b: {
c: {
d: {
e: {},
f: undefined
}
},
g: 2
}
}
cleanObject(object);
will result in
{
a: 1,
b: {
g: 2
}
}