source: imaps-frontend/node_modules/is-finalizationregistry/README.md

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

Update repo after prototype presentation

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