tree: 59fc75c1974639ca0beec764a609c6e3d493345f [path history] [tgz]
  1. .github/
  2. .eslintrc
  3. .nycrc
  4. CHANGELOG.md
  5. index.d.ts
  6. index.js
  7. LICENSE
  8. package.json
  9. README.md
  10. tsconfig.json
node_modules/hasown/README.md

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