source: imaps-frontend/node_modules/es-object-atoms/README.md@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[d565449]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## Example
13
14```js
15const assert = require('assert');
16
17const $Object = require('es-object-atoms');
[79a0317]18const isObject = require('es-object-atoms/isObject');
[d565449]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
[79a0317]28assert.equal(isObject(undefined), false);
29assert.equal(isObject(null), false);
30assert.equal(isObject({}), true);
31assert.equal(isObject([]), true);
32assert.equal(isObject(function () {}), true);
33
[d565449]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## Tests
43Simply clone the repo, `npm install`, and run `npm test`
44
45## Security
46
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-atoms
50[npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg
51[deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg
52[deps-url]: https://david-dm.org/ljharb/es-object-atoms
53[dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg
54[dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies
55[npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true
56[license-image]: https://img.shields.io/npm/l/es-object-atoms.svg
57[license-url]: LICENSE
58[downloads-image]: https://img.shields.io/npm/dm/es-object.svg
59[downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms
60[codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg
61[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-atoms
63[actions-url]: https://github.com/ljharb/es-object-atoms/actions
Note: See TracBrowser for help on using the repository browser.