Bakhtina Sofya b84cb877be 1st comm | il y a 3 semaines | |
---|---|---|
.. | ||
.github | il y a 3 semaines | |
test | il y a 3 semaines | |
.eslintrc | il y a 3 semaines | |
CHANGELOG.md | il y a 3 semaines | |
LICENSE | il y a 3 semaines | |
README.md | il y a 3 semaines | |
RequireObjectCoercible.d.ts | il y a 3 semaines | |
RequireObjectCoercible.js | il y a 3 semaines | |
ToObject.d.ts | il y a 3 semaines | |
ToObject.js | il y a 3 semaines | |
index.d.ts | il y a 3 semaines | |
index.js | il y a 3 semaines | |
package.json | il y a 3 semaines | |
tsconfig.json | il y a 3 semaines |
ES Object-related atoms: Object, ToObject, RequireObjectCoercible.
const assert = require('assert');
const $Object = require('es-object-atoms');
const ToObject = require('es-object-atoms/ToObject');
const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
assert.equal($Object, Object);
assert.throws(() => ToObject(null), TypeError);
assert.throws(() => ToObject(undefined), TypeError);
assert.throws(() => RequireObjectCoercible(null), TypeError);
assert.throws(() => RequireObjectCoercible(undefined), TypeError);
assert.deepEqual(RequireObjectCoercible(true), true);
assert.deepEqual(ToObject(true), Object(true));
const obj = {};
assert.equal(RequireObjectCoercible(obj), obj);
assert.equal(ToObject(obj), obj);
Simply clone the repo, npm install
, and run npm test
Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.