{"_id":"component-type","_rev":"3304169","name":"component-type","description":"Type assertions aka less-broken `typeof`","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-06-11T02:25:38.000Z","created":"2014-01-06T19:17:17.072Z","2.0.0":"2023-11-16T20:35:52.958Z","1.2.2":"2023-11-16T19:01:45.746Z","1.2.1":"2016-03-15T20:40:54.586Z","1.2.0":"2015-09-16T20:08:21.254Z","1.1.0":"2014-12-08T13:27:21.562Z","1.0.0":"2014-01-06T19:17:17.072Z"},"users":{"vkarpov15":true,"xek":true},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/component-type.git"},"versions":{"2.0.0":{"name":"component-type","version":"2.0.0","description":"Type assertions aka less-broken `typeof`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/component-type.git"},"funding":"https://github.com/sponsors/sindresorhus","exports":{"types":"./index.d.ts","default":"./index.js"},"main":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["typeof","type","types","check","utility"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"xo":{"rules":{"unicorn/prefer-module":"off"}},"gitHead":"dc939b473f0f1c2547115cdfca677b2044627605","bugs":{"url":"https://github.com/sindresorhus/component-type/issues"},"homepage":"https://github.com/sindresorhus/component-type#readme","_id":"component-type@2.0.0","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"bb11dbdeb772e6ad0f98b0d08322793d46ece7f9","size":2106,"noattachment":false,"key":"/component-type/-/component-type-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-type_2.0.0_1700166952730_0.6170664237697614"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-16T20:35:52.958Z","publish_time":1700166952958,"_source_registry_name":"default","_cnpm_publish_time":1700166952958},"1.2.2":{"name":"component-type","description":"Cross-browser type assertions (less broken typeof)","version":"1.2.2","keywords":["typeof","type","utility"],"dependencies":{},"main":"index.js","license":"MIT","funding":"https://github.com/sponsors/sindresorhus","repository":{"type":"git","url":"git+https://github.com/sindresorhus/component-type.git"},"gitHead":"a581cc14d0b46b8a4c96e2fc99fa76cd7faef5d9","bugs":{"url":"https://github.com/sindresorhus/component-type/issues"},"homepage":"https://github.com/sindresorhus/component-type#readme","_id":"component-type@1.2.2","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"4458ecc0c1871efc6288bfaff0cbdab08141d079","size":27808,"noattachment":false,"key":"/component-type/-/component-type-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-1.2.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-type_1.2.2_1700161305577_0.8999440302227528"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-16T19:01:45.746Z","publish_time":1700161305746,"_source_registry_name":"default","_cnpm_publish_time":1700161305746},"1.2.1":{"name":"component-type","description":"Cross-browser type assertions (less broken typeof)","version":"1.2.1","keywords":["typeof","type","utility"],"dependencies":{},"main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/component/type.git"},"gitHead":"a581cc14d0b46b8a4c96e2fc99fa76cd7faef5d9","bugs":{"url":"https://github.com/component/type/issues"},"homepage":"https://github.com/component/type#readme","_id":"component-type@1.2.1","scripts":{},"_shasum":"8a47901700238e4fc32269771230226f24b415a9","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"mattmueller","email":"mattmuelle@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"8a47901700238e4fc32269771230226f24b415a9","size":28055,"noattachment":false,"key":"/component-type/-/component-type-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-1.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/component-type-1.2.1.tgz_1458074453909_0.014398212544620037"},"directories":{},"publish_time":1458074454586,"_cnpm_publish_time":1458074454586,"_hasShrinkwrap":false},"1.2.0":{"name":"component-type","description":"Cross-browser type assertions (less broken typeof)","version":"1.2.0","keywords":["typeof","type","utility"],"dependencies":{},"main":"index.js","license":"MIT","repository":{"type":"git","url":"https://github.com/component/type.git"},"gitHead":"168462c30c13a5f777974e336c2e18d6ead64ef5","bugs":{"url":"https://github.com/component/type/issues"},"homepage":"https://github.com/component/type","_id":"component-type@1.2.0","scripts":{},"_shasum":"e279fc966ae3488ca44480103313569cffbf4c48","_from":".","_npmVersion":"2.6.1","_nodeVersion":"0.10.36","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"e279fc966ae3488ca44480103313569cffbf4c48","size":27994,"noattachment":false,"key":"/component-type/-/component-type-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-1.2.0.tgz"},"directories":{},"publish_time":1442434101254,"_cnpm_publish_time":1442434101254,"_hasShrinkwrap":false},"1.1.0":{"name":"component-type","description":"Cross-browser type assertions (less broken typeof)","version":"1.1.0","keywords":["typeof","type","utility"],"dependencies":{},"main":"index.js","repository":{"type":"git","url":"https://github.com/component/type.git"},"gitHead":"44c73293c7e2c71d6598ed4e58f34084f862f8d1","bugs":{"url":"https://github.com/component/type/issues"},"homepage":"https://github.com/component/type","_id":"component-type@1.1.0","scripts":{},"_shasum":"95b666aad53e5c8d1f2be135c45b5d499197c0c5","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.32","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"95b666aad53e5c8d1f2be135c45b5d499197c0c5","size":27864,"noattachment":false,"key":"/component-type/-/component-type-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-1.1.0.tgz"},"directories":{},"publish_time":1418045241562,"_cnpm_publish_time":1418045241562,"_hasShrinkwrap":false},"1.0.0":{"name":"component-type","description":"Cross-browser type assertions (less broken typeof)","version":"1.0.0","keywords":["typeof","type","utility"],"dependencies":{},"main":"index.js","repository":{"type":"git","url":"https://github.com/component/type.git"},"readmeFilename":"Readme.md","bugs":{"url":"https://github.com/component/type/issues"},"homepage":"https://github.com/component/type","_id":"component-type@1.0.0","dist":{"shasum":"1ed8812e32dd65099d433570757f111ea3d3d871","size":27737,"noattachment":false,"key":"/component-type/-/component-type-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/component-type/download/component-type-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"maxogden","email":"mogden@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1389035837072,"_cnpm_publish_time":1389035837072,"_hasShrinkwrap":false}},"readme":"# component-type\n\n> Type assertions aka less-broken `typeof`\n\n## Install\n\n```sh\nnpm install component-type\n```\n\n## Usage\n\n```js\nimport type from 'component-type';\n\nconst date = new Date();\n\nconsole.log(type(date));\n//=> 'date'\n```\n\n## API\n\n```js\ntype(new Date) === 'date'\ntype({}) === 'object'\ntype(null) === 'null'\ntype(undefined) === 'undefined'\ntype('hey') === 'string'\ntype(true) === 'boolean'\ntype(false) === 'boolean'\ntype(12) === 'number'\ntype(type) === 'function'\ntype(/asdf/) === 'regexp'\ntype((function(){ return arguments })()) === 'arguments'\ntype([]) === 'array'\ntype(document.createElement('div')) === 'element'\ntype(NaN) === 'nan'\ntype(new Error('Oh noes')) === 'error'\ntype(new Buffer) === 'buffer'\n```\n\nIt makes no guarantees about the correctness when fed untrusted user-input.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/component-type#readme","bugs":{"url":"https://github.com/sindresorhus/component-type/issues"},"license":"MIT"}