npm.io
1.0.1 • Published 8 years ago

clean-undefined

Licence
MIT
Version
1.0.1
Deps
0
Size
928 B
Vulns
0
Weekly
0

Clean Undefined

Delete object fields of undefined.

Installation

npm install clean-undefined

Usage

const clean = require('clean-undefined')

const obj1 = {name: 'Bob', age: undefined}
// { name: 'Bob', age: undefined }

const obj2 = clean(obj1)
// { name: 'Bob' }

obj1 === obj2
// true

License

MIT

Keywords