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