@f/defaults
Soft version of extend. Assigns own properties only if they are undefined in the original object.
Last updated 10 years ago by f .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @f/defaults 
SYNC missed versions from official npm registry.

defaults

Build status Git tag NPM version Code style

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 with defaults
  • defaults - Default values

Returns: obj with applied defaults.

License

MIT

Current Tags

  • 1.0.1                                ...           latest (10 years ago)

3 Versions

  • 1.0.1                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |