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