{"_id":"which-collection","_rev":"8207","name":"which-collection","description":"Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2023-03-20T07:17:39.000Z","created":"2019-11-13T20:00:49.653Z","1.0.1":"2020-01-26T21:12:29.195Z","1.0.0":"2019-11-13T20:00:49.653Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/inspect-js/which-collection.git"},"versions":{"1.0.1":{"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":{"shasum":"70eab71ebbbd2aefaf32f917082fc62cdcb70906","size":4371,"noattachment":false,"key":"/which-collection/-/which-collection-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/which-collection/download/which-collection-1.0.1.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_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,"publish_time":1580073149195,"_cnpm_publish_time":1580073149195},"1.0.0":{"name":"which-collection","version":"1.0.0","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","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":"^15.0.1","auto-changelog":"^1.16.2","eslint":"^6.6.0","for-each":"^0.3.3","object-inspect":"^1.7.0","safe-publish-latest":"^1.1.4","tape":"^4.11.0"},"dependencies":{"is-map":"^2.0.0","is-set":"^2.0.0","is-weakmap":"^2.0.0","is-weakset":"^2.0.0"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false},"gitHead":"abf79aef38fcd7d699f0cb00a8f1850960822973","_id":"which-collection@1.0.0","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"shasum":"303d38022473f4b7048b529b45f6c842d8814269","size":3839,"noattachment":false,"key":"/which-collection/-/which-collection-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/which-collection/download/which-collection-1.0.0.tgz"},"maintainers":[{"name":"ljharb","email":""}],"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-collection_1.0.0_1573675249568_0.7044027117797167"},"_hasShrinkwrap":false,"publish_time":1573675249653,"_cnpm_publish_time":1573675249653}},"readme":"# which-collection <sup>[![Version Badge][2]][1]</sup>\n\n[![Build Status][3]][4]\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]: http://versionbadg.es/inspect-js/which-collection.svg\n[3]: https://travis-ci.org/inspect-js/which-collection.svg\n[4]: https://travis-ci.org/inspect-js/which-collection\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[9]: https://ci.testling.com/inspect-js/which-collection.png\n[10]: https://ci.testling.com/inspect-js/which-collection\n[11]: https://nodei.co/npm/which-collection.png?downloads=true&stars=true\n[license-image]: http://img.shields.io/npm/l/which-collection.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/which-collection.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=which-collection\n","_attachments":{},"homepage":"https://github.com/inspect-js/which-collection#readme","bugs":{"url":"https://github.com/inspect-js/which-collection/issues"},"license":"MIT"}