Have ideas to improve npm?Join in the discussion! »

@zippytech/hasown

2.0.0 • Public • Published

hasown

JavaScript curried hasOwn helper.

Install

$ npm install @zippytech/hasown

Usage

Simple usage

var hasOwn = require('@zippytech/hasown')
var person = { name: 'bob' }
 
hasOwn(person, 'name') == true

Curried usage

var hasOwn = require('@zippytech/hasown')
var person = { lastName: 'willson' }
var child = Object.create(person)
child.age = 1
child.firstName = 'bob'
 
var childHasOwn = hasOwn(child)
 
for (var k in child) if (childHasOwn(k)){
    console.log(k, ' = ', child[k])
}

Test

$ make

Watch mode

$ make test-w

LICENSE

Apache2

Install

npm i @zippytech/hasown

DownloadsWeekly Downloads

39

Version

2.0.0

License

Apache-2.0

Last publish

Collaborators

  • avatar