![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | CHANGELOG.md | 8 months ago | 2.5K | |
![]() | LICENSE | 8 months ago | 1.1K | |
![]() | README.md | 8 months ago | 1.6K | |
![]() | index.d.ts | 8 months ago | 117 | |
![]() | index.js | 8 months ago | 206 | |
![]() | package.json | 8 months ago | 2.2K | |
![]() | tsconfig.json | 8 months ago | 73 |
A robust, ES3 compatible, "has own property" predicate.
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);
Simply clone the repo, npm install
, and run npm test