fxl 37aa67060c 08.01demo | hai 4 meses | |
---|---|---|
.. | ||
.github | hai 4 meses | |
.eslintrc | hai 4 meses | |
.nycrc | hai 4 meses | |
CHANGELOG.md | hai 4 meses | |
LICENSE | hai 4 meses | |
README.md | hai 4 meses | |
index.d.ts | hai 4 meses | |
index.js | hai 4 meses | |
package.json | hai 4 meses | |
tsconfig.json | hai 4 meses |
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