travel/admin/node_modules/es-object-atoms
yaosen 242417d45d init... 2024-06-24 11:28:18 +08:00
..
.github init... 2024-06-24 11:28:18 +08:00
test init... 2024-06-24 11:28:18 +08:00
.eslintrc init... 2024-06-24 11:28:18 +08:00
CHANGELOG.md init... 2024-06-24 11:28:18 +08:00
LICENSE init... 2024-06-24 11:28:18 +08:00
README.md init... 2024-06-24 11:28:18 +08:00
RequireObjectCoercible.d.ts init... 2024-06-24 11:28:18 +08:00
RequireObjectCoercible.js init... 2024-06-24 11:28:18 +08:00
ToObject.d.ts init... 2024-06-24 11:28:18 +08:00
ToObject.js init... 2024-06-24 11:28:18 +08:00
index.d.ts init... 2024-06-24 11:28:18 +08:00
index.js init... 2024-06-24 11:28:18 +08:00
package.json init... 2024-06-24 11:28:18 +08:00
tsconfig.json init... 2024-06-24 11:28:18 +08:00

README.md

es-object-atoms Version Badge

github actions coverage License Downloads

npm badge

ES Object-related atoms: Object, ToObject, RequireObjectCoercible.

Example

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);

Tests

Simply clone the repo, npm install, and run npm test

Security

Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.