own-or
Either use the object's own property, or a fallback
Last updated 8 years ago by isaacs .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install own-or 
SYNC missed versions from official npm registry.

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'

Current Tags

  • 1.0.0                                ...           latest (8 years ago)

1 Versions

  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |