{"_id":"which-boxed-primitive","_rev":"3745042","name":"which-boxed-primitive","description":"Which kind of boxed JS primitive is this?","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2025-02-13T06:28:24.000Z","created":"2019-08-10T22:28:55.043Z","1.1.1":"2024-12-16T05:48:44.026Z","1.1.0":"2024-12-02T20:24:49.156Z","1.0.2":"2020-12-14T22:36:48.931Z","1.0.1":"2019-08-11T02:12:03.677Z","1.0.0":"2019-08-10T22:28:55.043Z"},"users":{},"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/inspect-js/which-boxed-primitive.git"},"versions":{"1.1.1":{"name":"which-boxed-primitive","version":"1.1.1","description":"Which kind of boxed JS primitive is this?","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"tsc -p . && attw -P","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","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-boxed-primitive.git"},"keywords":["boxed","primitive","object","ecmascript","javascript","which"],"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-boxed-primitive/issues"},"homepage":"https://github.com/inspect-js/which-boxed-primitive#readme","dependencies":{"is-bigint":"^1.1.0","is-boolean-object":"^1.2.1","is-number-object":"^1.1.1","is-string":"^1.1.1","is-symbol":"^1.1.1"},"devDependencies":{"@arethetypeswrong/cli":"^0.17.1","@ljharb/eslint-config":"^21.1.1","@ljharb/tsconfig":"^0.2.2","@types/for-each":"^0.3.3","@types/object-inspect":"^1.13.0","@types/tape":"^5.7.0","auto-changelog":"^2.5.0","encoding":"^0.1.13","es-value-fixtures":"^1.5.0","eslint":"=8.8.0","for-each":"^0.3.3","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.3","safe-publish-latest":"^2.0.0","tape":"^5.9.0","typescript":"next"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"_id":"which-boxed-primitive@1.1.1","gitHead":"3cb1edfed48c1a749cb497fa05b8b3971f798613","types":"./index.d.ts","_nodeVersion":"23.4.0","_npmVersion":"10.9.2","dist":{"shasum":"d76ec27df7fa165f18d5808374a5fe23c29b176e","size":6732,"noattachment":false,"key":"/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/which-boxed-primitive/download/which-boxed-primitive-1.1.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/which-boxed-primitive_1.1.1_1734328123835_0.07296879180699811"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-16T05:48:44.026Z","publish_time":1734328124026,"_source_registry_name":"default","_cnpm_publish_time":1734328124026},"1.1.0":{"name":"which-boxed-primitive","version":"1.1.0","description":"Which kind of boxed JS primitive is this?","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"tsc -p . && attw -P","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","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-boxed-primitive.git"},"keywords":["boxed","primitive","object","ecmascript","javascript","which"],"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-boxed-primitive/issues"},"homepage":"https://github.com/inspect-js/which-boxed-primitive#readme","dependencies":{"is-bigint":"^1.1.0","is-boolean-object":"^1.2.0","is-number-object":"^1.1.0","is-string":"^1.1.0","is-symbol":"^1.1.0"},"devDependencies":{"@arethetypeswrong/cli":"^0.17.0","@ljharb/eslint-config":"^21.1.1","@ljharb/tsconfig":"^0.2.0","@types/for-each":"^0.3.3","@types/object-inspect":"^1.13.0","@types/tape":"^5.6.5","auto-changelog":"^2.5.0","encoding":"^0.1.13","es-value-fixtures":"^1.5.0","eslint":"=8.8.0","for-each":"^0.3.3","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.3","safe-publish-latest":"^2.0.0","tape":"^5.9.0","typescript":"next"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"engines":{"node":">= 0.4"},"_id":"which-boxed-primitive@1.1.0","gitHead":"7310c5f86e59ff4a7b94ed3b53815a98785f178d","types":"./index.d.ts","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"shasum":"2d850d6c4ac37b95441a67890e19f3fda8b6c6d9","size":6626,"noattachment":false,"key":"/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/which-boxed-primitive/download/which-boxed-primitive-1.1.0.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-boxed-primitive_1.1.0_1733171088990_0.316680455359889"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-02T20:24:49.156Z","publish_time":1733171089156,"_source_registry_name":"default","_cnpm_publish_time":1733171089156},"1.0.2":{"name":"which-boxed-primitive","version":"1.0.2","description":"Which kind of boxed JS primitive is this?","main":"index.js","scripts":{"preversion":"auto-changelog","prepublish":"not-in-publish || safe-publish-latest","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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-boxed-primitive.git"},"keywords":["boxed","primitive","object","ecmascript","javascript","which"],"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-boxed-primitive/issues"},"homepage":"https://github.com/inspect-js/which-boxed-primitive#readme","dependencies":{"is-bigint":"^1.0.1","is-boolean-object":"^1.1.0","is-number-object":"^1.0.4","is-string":"^1.0.5","is-symbol":"^1.0.3"},"devDependencies":{"@ljharb/eslint-config":"^17.3.0","aud":"^1.1.3","auto-changelog":"^2.2.1","eslint":"^7.15.0","has-symbols":"^1.0.1","in-publish":"^2.0.1","nyc":"^10.3.2","object-inspect":"^1.9.0","safe-publish-latest":"^1.1.4","tape":"^5.0.1"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"gitHead":"e2572398ae2be0d87527bc1726c1393a982a2f37","_id":"which-boxed-primitive@1.0.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"shasum":"13757bc89b209b049fe5d86430e21cf40a89a8e6","size":5674,"noattachment":false,"key":"/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/which-boxed-primitive/download/which-boxed-primitive-1.0.2.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-boxed-primitive_1.0.2_1607985408730_0.3073854540194627"},"_hasShrinkwrap":false,"publish_time":1607985408931,"_cnpm_publish_time":1607985408931},"1.0.1":{"name":"which-boxed-primitive","version":"1.0.1","description":"Which kind of boxed JS primitive is this?","main":"index.js","scripts":{"preversion":"auto-changelog","prepublish":"not-in-publish || safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud"},"repository":{"type":"git","url":"git+https://github.com/ljharb/which-boxed-primitive.git"},"keywords":["boxed","primitive","object","ecmascript","javascript","which"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/which-boxed-primitive/issues"},"homepage":"https://github.com/ljharb/which-boxed-primitive#readme","dependencies":{"is-bigint":"^1.0.0","is-boolean-object":"^1.0.0","is-number-object":"^1.0.3","is-string":"^1.0.4","is-symbol":"^1.0.2"},"devDependencies":{"@ljharb/eslint-config":"^14.0.2","auto-changelog":"^1.14.1","eslint":"^6.1.0","has-symbols":"^1.0.0","in-publish":"^2.0.0","object-inspect":"^1.6.0","safe-publish-latest":"^1.1.2","tape":"^4.11.0"},"auto-changelog":{"backfillLimit":false,"commitLimit":false,"template":"keepachangelog"},"gitHead":"2415eca06d0399e6aac2ee3bfa0924b2482eb27e","_id":"which-boxed-primitive@1.0.1","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"shasum":"cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1","size":5139,"noattachment":false,"key":"/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/which-boxed-primitive/download/which-boxed-primitive-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-boxed-primitive_1.0.1_1565489523536_0.07728945349327221"},"_hasShrinkwrap":false,"publish_time":1565489523677,"_cnpm_publish_time":1565489523677},"1.0.0":{"name":"which-boxed-primitive","version":"1.0.0","description":"Which kind of boxed JS primitive is this?","main":"index.js","scripts":{"preversion":"auto-changelog","prepublish":"safe-publish-latest","lint":"eslint .","pretest":"npm run lint","tests-only":"node test","test":"npm run tests-only","posttest":"npx aud"},"repository":{"type":"git","url":"git+https://github.com/ljharb/which-boxed-primitive.git"},"keywords":["boxed","primitive","object","ecmascript","javascript","which"],"author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ljharb/which-boxed-primitive/issues"},"homepage":"https://github.com/ljharb/which-boxed-primitive#readme","dependencies":{"is-bigint":"^1.0.0","is-boolean-object":"^1.0.0","is-number-object":"^1.0.3","is-string":"^1.0.4","is-symbol":"^1.0.2"},"devDependencies":{"@ljharb/eslint-config":"^14.0.2","auto-changelog":"^1.14.1","eslint":"^6.1.0","has-symbols":"^1.0.0","object-inspect":"^1.6.0","safe-publish-latest":"^1.1.2","tape":"^4.11.0"},"auto-changelog":{"backfillLimit":false,"commitLimit":false,"template":"keepachangelog"},"gitHead":"2df75e08d068449d1a27304f234f0f72f20ff208","_id":"which-boxed-primitive@1.0.0","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"shasum":"349fe7d6f1a00522fb4594054aba03aebf110545","size":4977,"noattachment":false,"key":"/which-boxed-primitive/-/which-boxed-primitive-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/which-boxed-primitive/download/which-boxed-primitive-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-boxed-primitive_1.0.0_1565476134905_0.12349053249965203"},"_hasShrinkwrap":false,"publish_time":1565476135043,"_cnpm_publish_time":1565476135043}},"readme":"# which-boxed-primitive <sup>[![Version Badge][2]][1]</sup>\n\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 boxed JS primitive is this? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag.\n\n## Example\n\n```js\nvar whichBoxedPrimitive = require('which-boxed-primitive');\nvar assert = require('assert');\n\n// unboxed primitives return `null`\n// boxed primitives return the builtin constructor name\n\nassert.equal(whichBoxedPrimitive(undefined), null);\nassert.equal(whichBoxedPrimitive(null), null);\n\nassert.equal(whichBoxedPrimitive(false), null);\nassert.equal(whichBoxedPrimitive(true), null);\nassert.equal(whichBoxedPrimitive(new Boolean(false)), 'Boolean');\nassert.equal(whichBoxedPrimitive(new Boolean(true)), 'Boolean');\n\nassert.equal(whichBoxedPrimitive(42), null);\nassert.equal(whichBoxedPrimitive(NaN), null);\nassert.equal(whichBoxedPrimitive(Infinity), null);\nassert.equal(whichBoxedPrimitive(new Number(42)), 'Number');\nassert.equal(whichBoxedPrimitive(new Number(NaN)), 'Number');\nassert.equal(whichBoxedPrimitive(new Number(Infinity)), 'Number');\n\nassert.equal(whichBoxedPrimitive(''), null);\nassert.equal(whichBoxedPrimitive('foo'), null);\nassert.equal(whichBoxedPrimitive(new String('')), 'String');\nassert.equal(whichBoxedPrimitive(new String('foo')), 'String');\n\nassert.equal(whichBoxedPrimitive(Symbol()), null);\nassert.equal(whichBoxedPrimitive(Object(Symbol()), 'Symbol');\n\nassert.equal(whichBoxedPrimitive(42n), null);\nassert.equal(whichBoxedPrimitive(Object(42n), 'BigInt');\n\n// non-boxed-primitive objects return `undefined`\nassert.equal(whichBoxedPrimitive([]), undefined);\nassert.equal(whichBoxedPrimitive({}), undefined);\nassert.equal(whichBoxedPrimitive(/a/g), undefined);\nassert.equal(whichBoxedPrimitive(new RegExp('a', 'g')), undefined);\nassert.equal(whichBoxedPrimitive(new Date()), undefined);\nassert.equal(whichBoxedPrimitive(function () {}), undefined);\nassert.equal(whichBoxedPrimitive(function* () {}), undefined);\nassert.equal(whichBoxedPrimitive(x => x * x), undefined);\nassert.equal(whichBoxedPrimitive([]), undefined);\n\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/which-boxed-primitive\n[2]: https://versionbadg.es/inspect-js/which-boxed-primitive.svg\n[5]: https://david-dm.org/inspect-js/which-boxed-primitive.svg\n[6]: https://david-dm.org/inspect-js/which-boxed-primitive\n[7]: https://david-dm.org/inspect-js/which-boxed-primitive/dev-status.svg\n[8]: https://david-dm.org/inspect-js/which-boxed-primitive#info=devDependencies\n[11]: https://nodei.co/npm/which-boxed-primitive.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/which-boxed-primitive.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/which-boxed-primitive.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=which-boxed-primitive\n","_attachments":{},"homepage":"https://github.com/inspect-js/which-boxed-primitive#readme","bugs":{"url":"https://github.com/inspect-js/which-boxed-primitive/issues"},"license":"MIT"}