
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Remove empty objects, empty arrays, empty strings,
nullandundefinedvalues from objects.
$ npm install --save obj-clean
const clean = require('obj-clean');
clean({foo: ''});
//=> {}
clean({foo: 'bar', baz: undefined});
//=> {foo: 'bar'}
clean({foo: {bar: 'baz', baz: null, bax: false}});
//=> {foo: {bar: 'baz', bax: false}}
clean({foo: {bar: 'baz', baz: {}});
//=> {foo: {bar: 'baz'}}
clean({foo: 'bar', baz: []});
//=> {foo: 'bar', baz: []}
clean({foo: [{unicorn: ''}]});
//=> {foo: []}
clean({foo: [{unicorn: '', rainbow: '🌈'}]});
//=> {foo: [{rainbow: '🌈'}]}
clean({foo: [{unicorn: ''}]}, {cleanArrays: false});
//=> {foo: [{unicorn: ''}]}
clean({foo: [{unicorn: ''}]}, {preserveArrays: false});
//=> {}
Returns a clean object.
Type: Object
The object to clean up.
Type: boolean
Default: true
Set to false if you want to remove empty arrays.
Type: boolean
Default: true
Set to false if you don't want to iterate over arrays and clean all the objects inside the array.
MIT © Sam Verschueren
FAQs
Remove empty objects, empty strings, null and undefined values from objects
We found that obj-clean demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.