npm package: @ryniaubenpm2/pariatur-eius-distinctio
Description: [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
Author: ryniaube
Latest version: 1.0.0

# @ryniaubenpm2/pariatur-eius-distinctio <sup>[![Version Badge][2]][1]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.

## Example

```js
var whichCollection = require('@ryniaubenpm2/pariatur-eius-distinctio');
var assert = require('assert');

assert.equal(false, whichCollection(undefined));
assert.equal(false, whichCollection(null));
assert.equal(false, whichCollection(false));
assert.equal(false, whichCollection(true));
assert.equal(false, whichCollection([]));
assert.equal(false, whichCollection({}));
assert.equal(false, whichCollection(/a/g));
assert.equal(false, whichCollection(new RegExp('a', 'g')));
assert.equal(false, whichCollection(new Date()));
assert.equal(false, whichCollection(42));
assert.equal(false, whichCollection(NaN));
assert.equal(false, whichCollection(Infinity));
assert.equal(false, whichCollection(new Number(42)));
assert.equal(false, whichCollection(42n));
assert.equal(false, whichCollection(Object(42n)));
assert.equal(false, whichCollection('foo'));
assert.equal(false, whichCollection(Object('foo')));
assert.equal(false, whichCollection(function () {}));
assert.equal(false, whichCollection(function* () {}));
assert.equal(false, whichCollection(x => x * x));
assert.equal(false, whichCollection([]));

assert.equal('Map', whichCollection(new Map()));
assert.equal('Set', whichCollection(new Set()));
assert.equal('WeakMap', whichCollection(new WeakMap()));
assert.equal('WeakSet', whichCollection(new WeakSet()));
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/@ryniaubenpm2/pariatur-eius-distinctio
[2]: https://versionbadg.es/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio.svg
[5]: https://david-dm.org/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio.svg
[6]: https://david-dm.org/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio
[7]: https://david-dm.org/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio/dev-status.svg
[8]: https://david-dm.org/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio#info=devDependencies
[11]: https://nodei.co/npm/@ryniaubenpm2/pariatur-eius-distinctio.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/@ryniaubenpm2/pariatur-eius-distinctio.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/@ryniaubenpm2/pariatur-eius-distinctio.svg
[downloads-url]: https://npm-stat.com/charts.html?package=@ryniaubenpm2/pariatur-eius-distinctio
[codecov-image]: https://codecov.io/gh/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/@ryniaubenpm2/pariatur-eius-distinctio
[actions-url]: https://github.com/ryniaubenpm2/pariatur-eius-distinctio/actions