0225304 479b0dd372 fit:first 1 week ago
..
.github 479b0dd372 fit:first 1 week ago
.eslintrc 479b0dd372 fit:first 1 week ago
.nycrc 479b0dd372 fit:first 1 week ago
CHANGELOG.md 479b0dd372 fit:first 1 week ago
LICENSE 479b0dd372 fit:first 1 week ago
README.md 479b0dd372 fit:first 1 week ago
index.d.ts 479b0dd372 fit:first 1 week ago
index.js 479b0dd372 fit:first 1 week ago
package.json 479b0dd372 fit:first 1 week ago
tsconfig.json 479b0dd372 fit:first 1 week ago

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