{"name":"which-collection","version":"1.0.1","description":"Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.","main":"index.js","type":"commonjs","exports":{".":[{"default":"./index.js"},"./index.js"],"./package.json":"./package.json"},"scripts":{"prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git+https://github.com/inspect-js/which-collection.git"},"keywords":["map","set","weakmap","weakset","collection.es6","es2015"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","bugs":{"url":"https://github.com/inspect-js/which-collection/issues"},"homepage":"https://github.com/inspect-js/which-collection#readme","devDependencies":{"@ljharb/eslint-config":"^16.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","for-each":"^0.3.3","object-inspect":"^1.7.0","safe-publish-latest":"^1.1.4","tape":"^5.0.0-next.4"},"dependencies":{"is-map":"^2.0.1","is-set":"^2.0.1","is-weakmap":"^2.0.1","is-weakset":"^2.0.1"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"088b8ceb3b645f51fdc962618717eb45562bbce5","_id":"which-collection@1.0.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==","shasum":"70eab71ebbbd2aefaf32f917082fc62cdcb70906","tarball":"http://registry-npm.ywwl.com/which-collection/download/which-collection-1.0.1.tgz","fileCount":10,"unpackedSize":10942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLgC9CRA9TVsSAnZWagAAupMP/0/jquCHaklZXi4SKpns\nrmPFWrMcEmJJFBlcss95V5xjU+2oI1qVz8zjWe0NRTXd0Mab8d5jPWxiWr5D\nSQVK20QIc80ZxJrHR+rG805W5peQcHpJGYCmhPUvbqJzP1dSdFhUvAPWYyfm\nX+L8p7xtZIkUZwGhSxsq2MgpmYD/6lJu1ADH97WmyuIgysfFjw1So82hvUF7\nOZdrdWhCrTF+dq93d7UdZ6QdkzTQfRra+7TApcBTLnRPkZyh6EJ9D2jZsHUU\nu8TdLHyG1vZmrqMJKPqmdjX4mVyZV36ldyEhTyqx2jBH18ZUxuf48ShKuEiG\nXuK3JAU76IyMBGHcUQTtI9V2Udab6tYGAY6Dm2DneSe2E5aZCHpLslx2QEsp\nLg0crH6GsN5rsV+dXrxwRn7mHx3OwRHeSp4cmZM9oZHT1LW86ZMJbbiKOKh5\no0UUI/17rKtktaTZEtGppvJ22aHKrXkZaJYxglWGBfzB29rxUrjX4i4xWi0S\nZ/XQpLOpkLVVdfXqAWvPsyd53vaYMg+NM6Vg0o/aZl6keg7u3hJ721MFIEON\np65DBnSxhzV/CXHM5nKSzNAVzKh3s5zSKwdrSfA0suZfDKwleoFi9dS0yEcK\nqaZRrIfIdhxyPKl/VFCQFZjFnximcKkXwfSitYZDKCwx5AT2lUVDvItCTrc2\nymXE\r\n=6CLz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAE/pu2DKPHUQSYJEf7JkPLKk5Six/VG5VEQ64O4S0nzAiEAkgC8FAwSDIMwBk4SOvfwigRBgEcAcJ09bO4X7+71FGo="}],"size":4371,"noattachment":false,"key":"/which-collection/-/which-collection-1.0.1.tgz"},"maintainers":[{"email":"ljharb@gmail.com","name":"ljharb"}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-collection_1.0.1_1580073148958_0.2885548563363387"},"_hasShrinkwrap":false,"readme":"# which-collection <sup>[![Version Badge][2]][1]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\nWhich kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.\n\n## Example\n\n```js\nvar whichCollection = require('which-collection');\nvar assert = require('assert');\n\nassert.equal(false, whichCollection(undefined));\nassert.equal(false, whichCollection(null));\nassert.equal(false, whichCollection(false));\nassert.equal(false, whichCollection(true));\nassert.equal(false, whichCollection([]));\nassert.equal(false, whichCollection({}));\nassert.equal(false, whichCollection(/a/g));\nassert.equal(false, whichCollection(new RegExp('a', 'g')));\nassert.equal(false, whichCollection(new Date()));\nassert.equal(false, whichCollection(42));\nassert.equal(false, whichCollection(NaN));\nassert.equal(false, whichCollection(Infinity));\nassert.equal(false, whichCollection(new Number(42)));\nassert.equal(false, whichCollection(42n));\nassert.equal(false, whichCollection(Object(42n)));\nassert.equal(false, whichCollection('foo'));\nassert.equal(false, whichCollection(Object('foo')));\nassert.equal(false, whichCollection(function () {}));\nassert.equal(false, whichCollection(function* () {}));\nassert.equal(false, whichCollection(x => x * x));\nassert.equal(false, whichCollection([]));\n\nassert.equal('Map', whichCollection(new Map()));\nassert.equal('Set', whichCollection(new Set()));\nassert.equal('WeakMap', whichCollection(new WeakMap()));\nassert.equal('WeakSet', whichCollection(new WeakSet()));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/which-collection\n[2]: https://versionbadg.es/inspect-js/which-collection.svg\n[5]: https://david-dm.org/inspect-js/which-collection.svg\n[6]: https://david-dm.org/inspect-js/which-collection\n[7]: https://david-dm.org/inspect-js/which-collection/dev-status.svg\n[8]: https://david-dm.org/inspect-js/which-collection#info=devDependencies\n[11]: https://nodei.co/npm/which-collection.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/which-collection.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/which-collection.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=which-collection\n[codecov-image]: https://codecov.io/gh/inspect-js/which-collection/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/which-collection/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/which-collection\n[actions-url]: https://github.com/inspect-js/which-collection/actions\n","publish_time":1580073149195,"_cnpm_publish_time":1580073149195,"dist-tags":{"latest":"1.0.2"}}