hasown
A robust, ES3 compatible, "has own property" predicate.
Last updated 8 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install hasown 
SYNC missed versions from official npm registry.

hasown Version Badge

github actions coverage License Downloads

npm badge

A robust, ES3 compatible, "has own property" predicate.

Example

const assert = require('assert');
const hasOwn = require('hasown');

assert.equal(hasOwn({}, 'toString'), false);
assert.equal(hasOwn([], 'length'), true);
assert.equal(hasOwn({ a: 42 }, 'a'), true);

Tests

Simply clone the repo, npm install, and run npm test

Current Tags

  • 2.0.2                                ...           latest (8 months ago)

4 Versions

  • 2.0.2                                ...           8 months ago
  • 2.0.1                                ...           9 months ago
  • 2.0.0                                ...           a year ago
  • 1.0.1                                ...           10 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE