潘超林 79770928d5 init: 初始化项目 2 weeks ago
..
.github 79770928d5 init: 初始化项目 2 weeks ago
.eslintrc 79770928d5 init: 初始化项目 2 weeks ago
.nycrc 79770928d5 init: 初始化项目 2 weeks ago
CHANGELOG.md 79770928d5 init: 初始化项目 2 weeks ago
LICENSE 79770928d5 init: 初始化项目 2 weeks ago
README.md 79770928d5 init: 初始化项目 2 weeks ago
index.d.ts 79770928d5 init: 初始化项目 2 weeks ago
index.js 79770928d5 init: 初始化项目 2 weeks ago
package.json 79770928d5 init: 初始化项目 2 weeks ago
tsconfig.json 79770928d5 init: 初始化项目 2 weeks 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