Name Last Update
..
LICENSE Loading commit data...
README.md Loading commit data...
own-or.js Loading commit data...
package.json Loading commit data...
test.js Loading commit data...

own-or

Either use the object's own property, or a fallback

Useful for setting default values.

API

ownOr(object, key, fallback)

USAGE

var ownOr = require('own-or')

var config = { some: 'configs' }

var foo = ownOr(config, 'bar', 'baz') // 'baz'
var some = ownOr(config, 'some', 'quux') // 'configs'