es-object-atoms
ES Object-related atoms: Object, ToObject, RequireObjectCoercible
Last updated 9 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install es-object-atoms 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.0.0                                ...           latest (9 months ago)

1 Versions

  • 1.0.0                                ...           9 months ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE