{"_id":"@bemoje/is-type","_rev":"5-d35a08ec8e801d2eb63e18a106243dc2","name":"@bemoje/is-type","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bemoje/is-type","version":"1.0.0","keywords":["check","type","constructor","creates","instances","question","instance","evaluate","istype"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/is-type@1.0.0","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-is-type#readme","bugs":{"url":"https://github.com/bemoje/bemoje-is-type/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"c04eb66a8b7ae5b4ad2fe028e16e1bb56e95a00c","tarball":"https://registry.npmjs.org/@bemoje/is-type/-/is-type-1.0.0.tgz","fileCount":5,"integrity":"sha512-1qK3QDaNZXQaZgGgrJsCVsRg/t9+IZqNg6Rs/lsgpFeygGC/O2gJm+EhqTVpqNUeqV9Rvfe9/7Mjghttmg/vSQ==","signatures":[{"sig":"MEUCIGs6o9bSOQoKNh3j+c55zsQ+c1shd0lVEY6ulQEiLDwSAiEAu77XoCnEdsRT0wZUkJNAH/WdFHJElMOa4qEQywi1yLI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepJ7QCRA9TVsSAnZWagAAgRYQAJJCbHe/kGqa9D4qom/q\naMvoqlVl9TSdH3K4/TR2Hw9TQq7D+2kSOJAejssw1rj/FrUa/taW5wnMkHy5\nppLgUU8Vj3ZiDxH1Rx7PeO7Z46pEbCVsqgbaH02h9LUVhEBOaWn9NnF4wh2x\nBNbml607i1IuH47Ut2jZxBnzkqR95gvgTBt2tVWHJJ38BfwO+EFP0NV+0Wk+\nEqZvWKtStriF4Yxuz2SbZZcEcbvI9gqQ6cCb6ET8ckLg8ww3dT3RC3ztvRTx\n+1QWD6RdXEIY9p+kZzEdwm/ty/uz8vcrE97+epxdLL/TagVjRfwcQsPuVL+X\nHM/Ql9R9MJlAqiiDSV9YzOcYdqr5rsyUlcG6mULr3bGrzi3TnQ788h1v7azk\nztaE4Dw6p031KGAeJO+K50K41LTvw652NxgYhZVDjR7iocfW0vzRCnXMJ6VC\nGQSd8+E24NIuzcX7+Md4GBAoAojQfQ0oPxRxWytWb6hJ5RnCaNpmdicuQg3j\nrKQepRD+2+qkFQ6NnDynPBpX9MnsC8+8+tLuKcznZU22nRbPHUPbFSnTVh4R\n9AJyZ7MJxUVKb8dpxTaUwN6epkvVbAtwDPZe9cSWl0p1Xn6IQscIDQlDLlNs\nG0uU1e3A7eRQIyNg1l8bulKbg0sGCLt6IBSCOnfyBZ6Q38XU0EeggktWRUHq\n6HvG\r\n=kC8a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/is-type.umd.js","github":{"user":"bemoje"},"module":"dist/is-type.esm.js","browser":"dist/is-type.umd.js","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/is-type.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/is-type.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-is-type","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-is-type.git","type":"git"},"_npmVersion":"6.12.1","description":"Check if a value is of the given type.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"chalk":"^4.0.0","@types/chalk":"^2.2.0","@bemoje/type-of":"^1.0.0","@bemoje/is-undefined":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.4.0","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/is-type_1.0.0_1587846864351_0.2912501032552173","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."},"1.0.1":{"name":"@bemoje/is-type","version":"1.0.1","keywords":["check","type","constructor","creates","instances","question","instance","evaluate","istype"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/is-type@1.0.1","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-is-type#readme","bugs":{"url":"https://github.com/bemoje/bemoje-is-type/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"c3e3be12eef0acca49ec42b6caefec068386b855","tarball":"https://registry.npmjs.org/@bemoje/is-type/-/is-type-1.0.1.tgz","fileCount":5,"integrity":"sha512-usWB73IS0pFxbKaXRPe6slwN4xkMyogpd42A1TLqn+JyRuHdt/a4px+c+CHFFRPwmt2eTn33tujqguV/h98aDQ==","signatures":[{"sig":"MEUCIFg/E5GM/ZQFLdsg8CGFKFktWLEH4UJwp+Md4YjpZW5nAiEAzSxePn/pO7j7Sq085AU1HqqFF8hAn3jbyCy+39hWk4c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqrBdCRA9TVsSAnZWagAAiqMP/1vilT/ahfUC3pUC9KZY\nfx0nLNIiUSy9QhktTmBt/oJM/CX2apYXncCvi2iqO58KC8/Yq0lBGPiDP+Q6\nE+ZvpiTqWizTMchmupUiSX6I0an2rWN4eP3f0UTmouH1xZnP1KudESwoN4hQ\nMTz/fugfxN95k/i/EgxHOu+DonMvirUpi2kxIDBMdmwrsyt+4x/BLR5KasYX\nRtylRNKJUGyLlwnVa4RK/v+iX6KJOAkwEwwV0PKMW1JbJi2dKPo50nYiGnHV\n0Hevrh1YnMCMZjnuL7FEzaS3M1SwionClXbrzHBeK+AmgQG+NxsshDOeMaWF\nGV0vqg++T1IY2isY6lTruxT8DvFrxgic00e4SGPVtpIto4IEVGiwvAuNcbOF\nZzuUsr2BsxBmgJD5vWoMfgrYMsCm5H9bYCnlc67BvQgScoVArVFtAGExcFBr\nFYSjAQVHcjl9zbGSZbs9FGB+CVPSL3Bbn/bYn656qDBUIHbXh80vB13KvJuJ\nfgi2UKHe4WuDyFJ28yFHv+GZQR7rztDAGFSUL7XEqsHalKqfOKHNjWCe78BS\nDIDXix5/nQjvsY8WChU4sqHOETmg983dQHXmEHnayMqY1KzusiJ4j8TLwsvX\nM0vjojAwWB1CVX4KD/ZTdxr8FiNlr+x+1zTH6//pewazMZeKISz2qEW/FFNh\n2eqG\r\n=Wzf0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/is-type.umd.js","github":{"user":"bemoje"},"module":"dist/is-type.esm.js","browser":"dist/is-type.umd.js","gitHead":"c19ccde981204d73b428d61e54e70ff75b86c00b","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/is-type.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/is-type.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-is-type","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-is-type.git","type":"git"},"_npmVersion":"6.12.1","description":"Check if a value is of the given type.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"chalk":"^4.0.0","@types/chalk":"^2.2.0","@bemoje/is-null":"^1.0.0","@bemoje/type-of":"^1.0.0","@bemoje/is-undefined":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.4.0","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/is-type_1.0.1_1588244573176_0.9119251090913316","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."},"1.0.2":{"name":"@bemoje/is-type","version":"1.0.2","keywords":["check","type","constructor","creates","instances","question","instance","evaluate","istype"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/is-type@1.0.2","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-is-type#readme","bugs":{"url":"https://github.com/bemoje/bemoje-is-type/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"a5e7e25f2c198fae81edde4b6fb9edd8996d606b","tarball":"https://registry.npmjs.org/@bemoje/is-type/-/is-type-1.0.2.tgz","fileCount":5,"integrity":"sha512-Euo/Ah9EEAdQVA5lkRxA1mstcrkggR9f4lQP9uhVr2yZoSZIjYDaDenZHSk7ipTebyb1RXypFyfbuyyQBIYBhg==","signatures":[{"sig":"MEYCIQC27ERfuTjm/c8UcZmqeH5IoRR7v/u+QOuwxNL1TdEnRQIhAPEz0R1r50UdjF2RsnOHdRC6/t396wMnC5WxBTYfrqqo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9570,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqsPFCRA9TVsSAnZWagAAAVwP/3eiIGV+eRucXkA8PTKq\neCG7IdDBOesZEGtctMYwUUduUhsVmGeVRG7d7lMAiYxnoiztcfPhrkM7nS9u\n3Ulj/CjL5oOzbUK+7HNNM7NvNxXrbM+Z8rM/9dGwNjDr4Yw0CbxkYL7JbthY\nOWLX9RuKXfBw4xiEeVxfPsZL0sGrDiAfEX2t8vGVgsqdlepFhX9jtQ0t8ppD\nmI+dV85hKD0UOpj6k9bb+tpClm0PPC2pz5dVRUjO6ho3v71VNHMnGO8wbSma\n3dnYOeP1E3PJ9q8Wp7SfXk13Oqh3qeRBRzvNCqQdG3dUTw4dA9cn8Z9HVsar\nOC7Ugcjt/SmuEuBIW+P1Q53DE5WBIz3ocvfk1eb+HA/Jsyy+Z2HfuQBUZHOL\nXo2w/7CX1svUacVMkXlFWipzS13Gmfhq/Ww8RVv56xzYdWgJL4zIW8rKhww6\nCHr/TEU64kRFMLfkvIhOVaOiwU6dmyX3jJt0LysN6al/cYWLuxsFc8uWM2ts\nlRgJZwx5ZYYbeEGYNCB+0yG7ZxZSP+vkzmckuzMLvDGY41vI2slOgHotuxqr\nOKBHIrabBZvVPBgE2sKqnw/EjCbT8QeRR4CdTwlC+qJYvQCufjCaTu7SQgBB\nEoYC9BIwEQlD9w9nDs29j8G6pS4JIfe5VhCfwWDmucMmZvWcpsw9xh/rpw0w\nEkST\r\n=GQcA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/is-type.umd.js","github":{"user":"bemoje"},"module":"dist/is-type.esm.js","browser":"dist/is-type.umd.js","gitHead":"ef296df8914835205dcf386586bcd2629f4a66d9","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/is-type.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/is-type.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-is-type","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-is-type.git","type":"git"},"_npmVersion":"6.12.1","description":"Check if a value is of the given type.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"chalk":"^4.0.0","@types/chalk":"^2.2.0","@bemoje/is-null":"^1.0.0","@bemoje/type-of":"^1.0.3","@bemoje/is-undefined":"^3.0.3"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.5.1","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/is-type_1.0.2_1588249541214_0.5664777615960952","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."}},"time":{"created":"2020-04-25T20:34:24.314Z","modified":"2025-06-17T23:57:10.384Z","1.0.0":"2020-04-25T20:34:24.558Z","1.0.1":"2020-04-30T11:02:53.288Z","1.0.2":"2020-04-30T12:25:41.305Z"},"bugs":{"url":"https://github.com/bemoje/bemoje-is-type/issues","email":"bemoje@gmail.com"},"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","homepage":"https://github.com/bemoje/bemoje-is-type#readme","keywords":["check","type","constructor","creates","instances","question","instance","evaluate","istype"],"repository":{"url":"git+https://github.com/bemoje/bemoje-is-type.git","type":"git"},"description":"Check if a value is of the given type.","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"readme":"# @bemoje/is-type\n\nCheck if a value is of the given type.\n\n#### Version\n\n<span><a href=\"https://npmjs.org/@bemoje/is-type\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/v/@bemoje/is-type\" alt=\"NPM version\" /></a></span>\n\n#### Travis CI\n\n<span><a href=\"https://npmjs.org/@bemoje/is-type\" title=\"View this project on NPM\"><img src=\"https://travis-ci.org/bemoje/bemoje-is-type.svg?branch=master\" alt=\"dependencies\" /></a></span>\n\n#### Dependencies\n\n<span><a href=\"https://npmjs.org/@bemoje/is-type\" title=\"View this project on NPM\"><img src=\"https://david-dm.org/bemoje/bemoje-is-type.svg\" alt=\"dependencies\" /></a></span>\n\n#### Stats\n\n<span><a href=\"https://npmjs.org/@bemoje/is-type\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/dt/@bemoje/is-type\" alt=\"NPM downloads\" /></a></span>\n<span><a href=\"https://github.com/bemoje/bemoje-is-type/fork\" title=\"Fork this project\"><img src=\"https://img.shields.io/github/forks/bemoje/bemoje-is-type\" alt=\"Forks\" /></a></span>\n\n#### Donate\n\n<span><a href=\"https://www.buymeacoffee.com/bemoje\" title=\"Donate to this project using Buy Me A Beer\"><img src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?label=Buy me a beer!\" alt=\"Buy Me A Beer donate button\" /></a></span>\n<span><a href=\"https://paypal.me/forstaaloen\" title=\"Donate to this project using Paypal\"><img src=\"https://img.shields.io/badge/paypal-donate-yellow.svg?label=PayPal\" alt=\"PayPal donate button\" /></a></span>\n\n## Installation\n\n```sh\nnpm install @bemoje/is-type\nnpm install --save @bemoje/is-type\nnpm install --save-dev @bemoje/is-type\n```\n\n## Usage\n\n```javascript\nimport isType from '@bemoje/is-type'\n\nisType()\n//=> undefined\n\nisType(String, 'asd')\n//=> true\n\nisType(String, String('asd'))\n//=> true\n\nisType(String, new String('asd'))\n//=> true\n\nisType(String, '')\n//=> true\n\nisType(Number, NaN)\n//=> false\n\nisType(Number, Infinity)\n//=> false\n\nisType(Number, 2)\n//=> true\n\nisType(Number, new Number(2))\n//=> true\n\nisType(Number, 1.1)\n//=> true\n\nisType(Array, [])\n//=> true\n\nisType(Array, new Uint16Array(1))\n//=> false\n\nisType(Uint16Array, new Uint16Array(1))\n//=> true\n\nisType(Object, {})\n//=> true\n\nclass Custom {}\n\nisType(Custom, new Custom())\n//=> true\n\nisType(null, null)\n//=> true\n\nisType(undefined, undefined)\n//=> true\n\nisType(void 0, void 0)\n//=> true\n\n```\n\n\n## Tests\nUses *Jest* to test module functionality. Run tests to get coverage details.\n\n```bash\nnpm run test\n```\n\n## API\n### isType\n\nCheck if a value is of the given type.\n\n##### Parameters\n\n-   `constructor` **([function][3] \\| [undefined][4] | null)** the constructor that creates instances of the type in question, which should be used to check whether or not the value, 'v' is an instance of that same constructor.\n\n-   `value` **any** The value to evaluate\n\n##### Returns\n**[boolean][5]** \n\n[1]: #istype\n\n[2]: #parameters\n\n[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n\n[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean","readmeFilename":"readme.md"}