zheng d4d8c5534b webpack 1 day ago
..
.github d4d8c5534b webpack 1 day ago
.nycrc d4d8c5534b webpack 1 day ago
CHANGELOG.md d4d8c5534b webpack 1 day ago
LICENSE d4d8c5534b webpack 1 day ago
README.md d4d8c5534b webpack 1 day ago
eslint.config.mjs d4d8c5534b webpack 1 day ago
index.d.ts d4d8c5534b webpack 1 day ago
index.js d4d8c5534b webpack 1 day ago
package.json d4d8c5534b webpack 1 day ago
tsconfig.json d4d8c5534b webpack 1 day 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