opusdev/vector-similarity-api
1
1# es-object-atoms <sup>[![Version Badge][npm-version-svg]][package-url]</sup>2 3[![github actions][actions-image]][actions-url]4[![coverage][codecov-image]][codecov-url]5[![License][license-image]][license-url]6[![Downloads][downloads-image]][downloads-url]7 8[![npm badge][npm-badge-png]][package-url]9 10ES Object-related atoms: Object, ToObject, RequireObjectCoercible.11 12## Example13 14```js15const assert = require('assert');16 17const $Object = require('es-object-atoms');18const isObject = require('es-object-atoms/isObject');19const ToObject = require('es-object-atoms/ToObject');20const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');21 22assert.equal($Object, Object);23assert.throws(() => ToObject(null), TypeError);24assert.throws(() => ToObject(undefined), TypeError);25assert.throws(() => RequireObjectCoercible(null), TypeError);26assert.throws(() => RequireObjectCoercible(undefined), TypeError);27 28assert.equal(isObject(undefined), false);29assert.equal(isObject(null), false);30assert.equal(isObject({}), true);31assert.equal(isObject([]), true);32assert.equal(isObject(function () {}), true);33 34assert.deepEqual(RequireObjectCoercible(true), true);35assert.deepEqual(ToObject(true), Object(true));36 37const obj = {};38assert.equal(RequireObjectCoercible(obj), obj);39assert.equal(ToObject(obj), obj);40```41 42## Tests43Simply clone the repo, `npm install`, and run `npm test`44 45## Security46 47Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.48 49[package-url]: https://npmjs.org/package/es-object-atoms50[npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg51[deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg52[deps-url]: https://david-dm.org/ljharb/es-object-atoms53[dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg54[dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies55[npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true56[license-image]: https://img.shields.io/npm/l/es-object-atoms.svg57[license-url]: LICENSE58[downloads-image]: https://img.shields.io/npm/dm/es-object.svg59[downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms60[codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg61[codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/62[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms63[actions-url]: https://github.com/ljharb/es-object-atoms/actions64 