904118851 29c4522d7e 123 8 ماه پیش
..
.github 29c4522d7e 123 8 ماه پیش
.eslintrc 29c4522d7e 123 8 ماه پیش
.nycrc 29c4522d7e 123 8 ماه پیش
CHANGELOG.md 29c4522d7e 123 8 ماه پیش
LICENSE 29c4522d7e 123 8 ماه پیش
README.md 29c4522d7e 123 8 ماه پیش
index.d.ts 29c4522d7e 123 8 ماه پیش
index.js 29c4522d7e 123 8 ماه پیش
package.json 29c4522d7e 123 8 ماه پیش
tsconfig.json 29c4522d7e 123 8 ماه پیش

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