source: imaps-frontend/node_modules/es-set-tostringtag/README.md

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

F4 Finalna Verzija

  • Property mode set to 100644
File size: 2.2 KB
Line 
1# es-set-tostringtag <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
10A helper to optimistically set Symbol.toStringTag, when possible.
11
12## Example
13Most common usage:
14```js
15var assert = require('assert');
16var setToStringTag = require('es-set-tostringtag');
17
18var obj = {};
19
20assert.equal(Object.prototype.toString.call(obj), '[object Object]');
21
22setToStringTag(obj, 'tagged!');
23
24assert.equal(Object.prototype.toString.call(obj), '[object tagged!]');
25```
26
27## Options
28An optional options argument can be provided as the third argument. The available options are:
29
30### `force`
31If the `force` option is set to `true`, the toStringTag will be set even if it is already set.
32
33### `nonConfigurable`
34If the `nonConfigurable` option is set to `true`, the toStringTag will be defined as non-configurable when possible.
35
36## Tests
37Simply clone the repo, `npm install`, and run `npm test`
38
39[package-url]: https://npmjs.com/package/es-set-tostringtag
40[npm-version-svg]: https://versionbadg.es/es-shims/es-set-tostringtag.svg
41[deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag.svg
42[deps-url]: https://david-dm.org/es-shims/es-set-tostringtag
43[dev-deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag/dev-status.svg
44[dev-deps-url]: https://david-dm.org/es-shims/es-set-tostringtag#info=devDependencies
45[npm-badge-png]: https://nodei.co/npm/es-set-tostringtag.png?downloads=true&stars=true
46[license-image]: https://img.shields.io/npm/l/es-set-tostringtag.svg
47[license-url]: LICENSE
48[downloads-image]: https://img.shields.io/npm/dm/es-set-tostringtag.svg
49[downloads-url]: https://npm-stat.com/charts.html?package=es-set-tostringtag
50[codecov-image]: https://codecov.io/gh/es-shims/es-set-tostringtag/branch/main/graphs/badge.svg
51[codecov-url]: https://app.codecov.io/gh/es-shims/es-set-tostringtag/
52[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/es-set-tostringtag
53[actions-url]: https://github.com/es-shims/es-set-tostringtag/actions
Note: See TracBrowser for help on using the repository browser.