own-or

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

  • own-or

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
own-or
311.0.06 years ago6 years agoMinified + gzip package size for own-or in KB

Readme

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'