var has = require('keyarray-has')
var assert = require('assert')
assert.throws(function () {
has({}, null)
}, TypeError)
assert.throws(function () {
has(null, [0])
}, TypeError)
assert(has({a: 1}, ['a']) === true)
assert(has({a: 1}, ['b']) === false)
assert(has({a: {b: 1}}, ['a', 'b']) === true)
assert(has({a: {b: 1}}, ['a', 'c']) === false)
assert(has({a: ['string']}, ['a', 0]) === true)
Recursive hasOwnProperty taking a key array
License
kemitchell/keyarray-has.js
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Recursive hasOwnProperty taking a key array
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published