zheng f326829555 仓库 před 2 týdny
..
.github f326829555 仓库 před 2 týdny
.nycrc f326829555 仓库 před 2 týdny
CHANGELOG.md f326829555 仓库 před 2 týdny
LICENSE f326829555 仓库 před 2 týdny
README.md f326829555 仓库 před 2 týdny
eslint.config.mjs f326829555 仓库 před 2 týdny
index.d.ts f326829555 仓库 před 2 týdny
index.js f326829555 仓库 před 2 týdny
package.json f326829555 仓库 před 2 týdny
tsconfig.json f326829555 仓库 před 2 týdny

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