Bakhtina Sofya b84cb877be 1st comm | há 3 semanas atrás | |
---|---|---|
.. | ||
.github | há 3 semanas atrás | |
test | há 3 semanas atrás | |
.eslintrc | há 3 semanas atrás | |
CHANGELOG.md | há 3 semanas atrás | |
LICENSE | há 3 semanas atrás | |
README.md | há 3 semanas atrás | |
RequireObjectCoercible.d.ts | há 3 semanas atrás | |
RequireObjectCoercible.js | há 3 semanas atrás | |
ToObject.d.ts | há 3 semanas atrás | |
ToObject.js | há 3 semanas atrás | |
index.d.ts | há 3 semanas atrás | |
index.js | há 3 semanas atrás | |
package.json | há 3 semanas atrás | |
tsconfig.json | há 3 semanas atrás |
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.