personal/api/node_modules/hasown
shenjianZ 71554afae8 add api/node_modules 2025-02-27 17:37:49 +08:00
..
.github add api/node_modules 2025-02-27 17:37:49 +08:00
.eslintrc add api/node_modules 2025-02-27 17:37:49 +08:00
.nycrc add api/node_modules 2025-02-27 17:37:49 +08:00
CHANGELOG.md add api/node_modules 2025-02-27 17:37:49 +08:00
LICENSE add api/node_modules 2025-02-27 17:37:49 +08:00
README.md add api/node_modules 2025-02-27 17:37:49 +08:00
index.d.ts add api/node_modules 2025-02-27 17:37:49 +08:00
index.js add api/node_modules 2025-02-27 17:37:49 +08:00
package.json add api/node_modules 2025-02-27 17:37:49 +08:00
tsconfig.json add api/node_modules 2025-02-27 17:37:49 +08:00

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