Name Last Update
..
.github Loading commit data...
.eslintrc Loading commit data...
.nycrc Loading commit data...
CHANGELOG.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
index.d.ts Loading commit data...
index.d.ts.map Loading commit data...
index.js Loading commit data...
package.json Loading commit data...
tsconfig.json Loading commit data...

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