source: imaps-frontend/node_modules/es-to-primitive/README.md@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 2.2 KB
Line 
1# es-to-primitive <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
3[![github actions][actions-image]][actions-url]
4[![coverage][codecov-image]][codecov-url]
5[![dependency status][deps-svg]][deps-url]
6[![dev dependency status][dev-deps-svg]][dev-deps-url]
7[![License][license-image]][license-url]
8[![Downloads][downloads-image]][downloads-url]
9
10[![npm badge][npm-badge-png]][package-url]
11
12ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.
13When different versions of the spec conflict, the default export will be the latest version of the abstract operation.
14Alternative versions will also be available under an `es5`/`es2015` exported property if you require a specific version.
15
16## Example
17
18```js
19var toPrimitive = require('es-to-primitive');
20var assert = require('assert');
21
22assert(toPrimitive(function () {}) === String(function () {}));
23
24var date = new Date();
25assert(toPrimitive(date) === String(date));
26
27assert(toPrimitive({ valueOf: function () { return 3; } }) === 3);
28
29assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3]));
30
31var sym = Symbol();
32assert(toPrimitive(Object(sym)) === sym);
33```
34
35## Tests
36Simply clone the repo, `npm install`, and run `npm test`
37
38[package-url]: https://npmjs.org/package/es-to-primitive
39[npm-version-svg]: https://versionbadg.es/ljharb/es-to-primitive.svg
40[deps-svg]: https://david-dm.org/ljharb/es-to-primitive.svg
41[deps-url]: https://david-dm.org/ljharb/es-to-primitive
42[dev-deps-svg]: https://david-dm.org/ljharb/es-to-primitive/dev-status.svg
43[dev-deps-url]: https://david-dm.org/ljharb/es-to-primitive#info=devDependencies
44[npm-badge-png]: https://nodei.co/npm/es-to-primitive.png?downloads=true&stars=true
45[license-image]: https://img.shields.io/npm/l/es-to-primitive.svg
46[license-url]: LICENSE
47[downloads-image]: https://img.shields.io/npm/dm/es-to-primitive.svg
48[downloads-url]: https://npm-stat.com/charts.html?package=es-to-primitive
49[codecov-image]: https://codecov.io/gh/ljharb/es-to-primitive/branch/main/graphs/badge.svg
50[codecov-url]: https://app.codecov.io/gh/ljharb/es-to-primitive/
51[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-to-primitive
52[actions-url]: https://github.com/ljharb/es-to-primitive/actions
Note: See TracBrowser for help on using the repository browser.