keyarray-has

recursive hasOwnProperty taking an array of keys

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
keyarray-has
001.0.06 years ago8 years agoMinified + gzip package size for keyarray-has in KB

Readme

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)