{"name":"which-builtin-type","version":"1.2.1","description":"What is the type of this builtin JS value?","main":"index.js","types":"index.d.ts","exports":{".":"./index.js","./package.json":"./package.json"},"sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","prelint":"evalmd README.md","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-builtin-type.git"},"keywords":["type","builtin","ecmascript"],"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-builtin-type/issues"},"homepage":"https://github.com/inspect-js/which-builtin-type#readme","dependencies":{"call-bound":"^1.0.2","function.prototype.name":"^1.1.6","has-tostringtag":"^1.0.2","is-async-function":"^2.0.0","is-date-object":"^1.1.0","is-finalizationregistry":"^1.1.0","is-generator-function":"^1.0.10","is-regex":"^1.2.1","is-weakref":"^1.0.2","isarray":"^2.0.5","which-boxed-primitive":"^1.1.0","which-collection":"^1.0.2","which-typed-array":"^1.1.16"},"devDependencies":{"@arethetypeswrong/cli":"^0.17.1","@ljharb/eslint-config":"^21.1.1","@ljharb/tsconfig":"^0.2.2","@types/for-each":"^0.3.3","@types/function.prototype.name":"^1.1.4","@types/is-async-function":"^2.0.3","@types/is-date-object":"^1.0.4","@types/is-generator-function":"^1.0.3","@types/is-weakref":"^1.0.0","@types/make-arrow-function":"^1.2.2","@types/make-async-function":"^1.0.2","@types/object-inspect":"^1.13.0","@types/object.assign":"^4.1.0","@types/tape":"^5.6.5","@types/which-boxed-primitive":"^1.0.3","auto-changelog":"^2.5.0","available-typed-arrays":"^1.0.7","encoding":"^0.1.13","eslint":"=8.8.0","evalmd":"^0.0.19","for-each":"^0.3.3","has-bigints":"^1.0.2","has-symbols":"^1.1.0","in-publish":"^2.0.1","make-arrow-function":"^1.2.0","make-async-function":"^1.0.0","make-generator-function":"^2.0.0","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.3","object.assign":"^4.1.5","safe-publish-latest":"^2.0.0","tape":"^5.9.0","typescript":"next"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"_id":"which-builtin-type@1.2.1","gitHead":"fccdad16413f7a2f2eae328f304d0044edb9a11b","_nodeVersion":"23.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==","shasum":"89183da1b4907ab089a6b02029cc5d8d6574270e","tarball":"http://registry-npm.ywwl.com/which-builtin-type/download/which-builtin-type-1.2.1.tgz","fileCount":10,"unpackedSize":30041,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGJWDlbYAQVHrJkcx/AoSJ7jnQ1hCx68rzTGKGoYgPpAiEApZNg2H6Jbqah0u2btijga8RGc373s0+9AnMzfzweN2k="}],"size":9377,"noattachment":false,"key":"/which-builtin-type/-/which-builtin-type-1.2.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/which-builtin-type_1.2.1_1734075671545_0.6624786456434086"},"_hasShrinkwrap":false,"readme":"# which-builtin-type <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nWhat is the type of this builtin JavaScript value? Works cross-realm, without `instanceof`, and can not be fooled by a `constructor` property.\n\n## Example\n\n```js\nvar whichBuiltinType = require('which-builtin-type');\nvar assert = require('assert');\n\nassert.equal(undefined, whichBuiltinType(undefined));\nassert.equal(null, whichBuiltinType(null));\nassert.equal('Boolean', whichBuiltinType(false));\nassert.equal('Boolean', whichBuiltinType(true));\nassert.equal('Array', whichBuiltinType([]));\nassert.equal('Object', whichBuiltinType({}));\nassert.equal('RegExp', whichBuiltinType(/a/g));\nassert.equal('RegExp', whichBuiltinType(new RegExp('a', 'g')));\nassert.equal('Date', whichBuiltinType(new Date()));\nassert.equal('Number', whichBuiltinType(42));\nassert.equal('Number', whichBuiltinType(NaN));\nassert.equal('Number', whichBuiltinType(Infinity));\nassert.equal('Number', whichBuiltinType(new Number(42)));\nassert.equal('String', whichBuiltinType('foo'));\nassert.equal('String', whichBuiltinType(Object('foo')));\nassert.equal('Function', whichBuiltinType(function () {}));\nassert.equal('GeneratorFunction', whichBuiltinType(function* () {}));\nassert.equal('Function', whichBuiltinType(x => x * x));\nassert.equal('Array', whichBuiltinType([]));\nassert.equal('Int8Array', whichBuiltinType(new Int8Array()));\nassert.equal('Uint8Array', whichBuiltinType(new Uint8Array()));\nassert.equal('Uint8ClampedArray', whichBuiltinType(new Uint8ClampedArray()));\nassert.equal('Int16Array', whichBuiltinType(new Int16Array()));\nassert.equal('Uint16Array', whichBuiltinType(new Uint16Array()));\nassert.equal('Int32Array', whichBuiltinType(new Int32Array()));\nassert.equal('Uint32Array', whichBuiltinType(new Uint32Array()));\nassert.equal('Float32Array', whichBuiltinType(new Float32Array()));\nassert.equal('Float64Array', whichBuiltinType(new Float64Array()));\nassert.equal('BigInt64Array', whichBuiltinType(new BigInt64Array()));\nassert.equal('BigUint64Array', whichBuiltinType(new BigUint64Array()));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/which-builtin-type\n[npm-version-svg]: https://versionbadg.es/inspect-js/which-builtin-type.svg\n[deps-svg]: https://david-dm.org/inspect-js/which-builtin-type.svg\n[deps-url]: https://david-dm.org/inspect-js/which-builtin-type\n[dev-deps-svg]: https://david-dm.org/inspect-js/which-builtin-type/dev-status.svg\n[dev-deps-url]: https://david-dm.org/inspect-js/which-builtin-type#info=devDependencies\n[npm-badge-png]: https://which-builtin-type/which-builtin-type.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/which-builtin-type.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/which-builtin-type.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=which-builtin-type\n[codecov-image]: https://codecov.io/gh/inspect-js/which-builtin-type/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/which-builtin-type/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/which-builtin-type\n[actions-url]: https://github.com/inspect-js/which-builtin-type/actions\n","publish_time":1734075671718,"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_cnpm_publish_time":1734075671718,"dist-tags":{"latest":"1.2.1"}}