冯博深 f143f24da4 first 1 өдөр өмнө
..
.github f143f24da4 first 1 өдөр өмнө
.eslintrc f143f24da4 first 1 өдөр өмнө
.nycrc f143f24da4 first 1 өдөр өмнө
CHANGELOG.md f143f24da4 first 1 өдөр өмнө
LICENSE f143f24da4 first 1 өдөр өмнө
README.md f143f24da4 first 1 өдөр өмнө
index.d.ts f143f24da4 first 1 өдөр өмнө
index.js f143f24da4 first 1 өдөр өмнө
package.json f143f24da4 first 1 өдөр өмнө
tsconfig.json f143f24da4 first 1 өдөр өмнө

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