source: imaps-frontend/node_modules/is-weakset/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.9 KB
RevLine 
[d565449]1# is-weakset <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
10Is this value a JS WeakSet? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
11
12## Example
13
14```js
15var isWeakSet = require('is-weakset');
16assert(!isWeakSet(function () {}));
17assert(!isWeakSet(null));
18assert(!isWeakSet(function* () { yield 42; return Infinity; });
19assert(!isWeakSet(Symbol('foo')));
20assert(!isWeakSet(1n));
21assert(!isWeakSet(Object(1n)));
22
23assert(!isWeakSet(new Set()));
24assert(!isWeakSet(new WeakMap()));
25assert(!isWeakSet(new Map()));
26
27assert(isWeakSet(new WeakSet()));
28
29class MyWeakSet extends WeakSet {}
30assert(isWeakSet(new MyWeakSet()));
31```
32
33## Tests
34Simply clone the repo, `npm install`, and run `npm test`
35
36[package-url]: https://npmjs.org/package/is-weakset
37[npm-version-svg]: https://versionbadg.es/inspect-js/is-weakset.svg
38[deps-svg]: https://david-dm.org/inspect-js/is-weakset.svg
39[deps-url]: https://david-dm.org/inspect-js/is-weakset
40[dev-deps-svg]: https://david-dm.org/inspect-js/is-weakset/dev-status.svg
41[dev-deps-url]: https://david-dm.org/inspect-js/is-weakset#info=devDependencies
42[npm-badge-png]: https://nodei.co/npm/is-weakset.png?downloads=true&stars=true
43[license-image]: https://img.shields.io/npm/l/is-weakset.svg
44[license-url]: LICENSE
45[downloads-image]: https://img.shields.io/npm/dm/is-weakset.svg
46[downloads-url]: https://npm-stat.com/charts.html?package=is-weakset
47[codecov-image]: https://codecov.io/gh/inspect-js/is-weakset/branch/main/graphs/badge.svg
48[codecov-url]: https://app.codecov.io/gh/inspect-js/is-weakset/
49[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-weakset
50[actions-url]: https://github.com/inspect-js/is-weakset/actions
Note: See TracBrowser for help on using the repository browser.