caoge c760052ff9 机车状态修改 | 8 months ago | |
---|---|---|
.. | ||
.github | 8 months ago | |
.eslintrc | 8 months ago | |
.nycrc | 8 months ago | |
CHANGELOG.md | 8 months ago | |
LICENSE | 8 months ago | |
README.md | 8 months ago | |
index.d.ts | 8 months ago | |
index.d.ts.map | 8 months ago | |
index.js | 8 months ago | |
package.json | 8 months ago | |
tsconfig.json | 8 months ago |
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