source: imaps-frontend/node_modules/is-map/README.md@ d565449

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# is-map <sup>[![Version Badge][2]][1]</sup>
2
3[![github actions][actions-image]][actions-url]
4[![coverage][codecov-image]][codecov-url]
5[![dependency status][5]][6]
6[![dev dependency status][7]][8]
7[![License][license-image]][license-url]
8[![Downloads][downloads-image]][downloads-url]
9
10[![npm badge][11]][1]
11
12Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
13
14## Example
15
16```js
17var isMap = require('is-map');
18assert(!isMap(function () {}));
19assert(!isMap(null));
20assert(!isMap(function* () { yield 42; return Infinity; });
21assert(!isMap(Symbol('foo')));
22assert(!isMap(1n));
23assert(!isMap(Object(1n)));
24
25assert(!isMap(new Set()));
26assert(!isMap(new WeakSet()));
27assert(!isMap(new WeakMap()));
28
29assert(isMap(new Map()));
30
31class MyMap extends Map {}
32assert(isMap(new MyMap()));
33```
34
35## Tests
36Simply clone the repo, `npm install`, and run `npm test`
37
38[1]: https://npmjs.org/package/is-map
39[2]: https://versionbadg.es/inspect-js/is-map.svg
40[5]: https://david-dm.org/inspect-js/is-map.svg
41[6]: https://david-dm.org/inspect-js/is-map
42[7]: https://david-dm.org/inspect-js/is-map/dev-status.svg
43[8]: https://david-dm.org/inspect-js/is-map#info=devDependencies
44[11]: https://nodei.co/npm/is-map.png?downloads=true&stars=true
45[license-image]: https://img.shields.io/npm/l/is-map.svg
46[license-url]: LICENSE
47[downloads-image]: https://img.shields.io/npm/dm/is-map.svg
48[downloads-url]: https://npm-stat.com/charts.html?package=is-map
49[codecov-image]: https://codecov.io/gh/inspect-js/is-map/branch/main/graphs/badge.svg
50[codecov-url]: https://app.codecov.io/gh/inspect-js/is-map/
51[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-map
52[actions-url]: https://github.com/inspect-js/is-map/actions
Note: See TracBrowser for help on using the repository browser.