@f/defaults
v1.0.1
Published
Soft version of extend. Assigns own properties only if they are undefined in the original object.
Downloads
1,490
Readme
defaults
Soft version of extend. Assigns own properties only if they are undefined in the original object.
Installation
$ npm install @f/defaults
Usage
var defaults = require('@f/defaults')
defaults({a: 1}, {a: 2}) // => {a: 1}
defaults({a: 1}, {b: 2}) // => {a: 1, b: 2}
API
defaults(obj, defaults)
obj
- Object to extend withdefaults
defaults
- Default values
Returns: obj
with applied defaults
.
License
MIT