{"name":"is-type-of","version":"1.2.1","description":"complete type checking for node","main":"index.js","scripts":{"test":"nyc mocha test/*.test.js"},"repository":{"type":"git","url":"git://github.com/node-modules/is-type-of.git"},"keywords":["typeof","checker","type","is"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/is-type-of/issues"},"homepage":"https://github.com/node-modules/is-type-of","dependencies":{"core-util-is":"^1.0.2","is-class-hotfix":"~0.0.6","isstream":"~0.1.2"},"devDependencies":{"autod":"^2.9.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","contributors":"*","long":"^3.2.0","mocha":"^3.5.0","nyc":"^11.1.0","semver":"^5.4.1"},"gitHead":"de75506d32106add08907a005716a77a26e31e19","_id":"is-type-of@1.2.1","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"dist":{"integrity":"sha512-uK0kyX9LZYhSDS7H2sVJQJop1UnWPWmo5RvR3q2kFH6AUHYs7sOrVg0b4nyBHw29kRRNFofYN/JbHZDlHiItTA==","shasum":"e263ec3857aceb4f28c47130ec78db09a920f8c5","tarball":"http://registry-npm.ywwl.com/is-type-of/download/is-type-of-1.2.1.tgz","fileCount":5,"unpackedSize":7453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpRaDCRA9TVsSAnZWagAA6DcP/AupD+y27dkLLY5Oh7NK\nvQV5ZtP77pHBwdcjZJJpHyCxmKP9DVLrtgH7Vjw3dmwcvVlRENL4e3fBNd96\nzGQVefd9OL7wqXze/oYHP2LAD4+9oqrw/7/LiErrXs+mwPOmbjH146G87xfO\n+RmK1zBq/6B9puMx3S1Gsph+op+hbHR4nEq9ufG32r9iAHLjeVGgU1m1ix0/\ntTTcy69xlVsRr1IhUC564o6sF5U6/oBu3XpVyeF2sH6xOzQZHIpPeG8no5L9\nt/rIJmlUWbhh2pIQ0CPD75z0BRFyQr1ZyhF4ooeTNvtb4Ez2WgbKmG/r23vy\ngFjR0vV2fds3nl+QNcI55fPv1dIx8mtzi2yALnGU0g40bjhv+ULDS+ESloyM\nqPgGy0Ft5gUxYrmBi1UjuCLSqwyR35+htvkzQy6jWyHdy2e/f8ytRmkkJas1\n/nv9qrHgwQa41jxmPUeyXI/CgnA9aUK2vWeQ9cNM7aRE41wcIPRha8pCZMvb\nKeqVwIrW7DkWcRpcl37WK5hJ3Pw0bIyZZrME7yPaQKUWLpmRLwwyFuXohtPX\nh3/pYGeEnELVduM+yYwQQXIy4daWFBXhm9QLakUtXe8xmWYSU1Tm1MmGdhnW\nUAjSpLnw9f+DEc+54TjepXkEu/b9J4o2cwG0IIfNr1TxXrNC8CQJCRQP8Sed\nv7qq\r\n=2uWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClif1PcHao85F6ZGmWV3zlN0b+EBDwHWnU7God4PqUIQIhAKgeiCMP2zmova7Tz0BQO6R5hgieuAvZzJfiBeyxnbFA"}],"size":3037,"noattachment":false,"key":"/is-type-of/-/is-type-of-1.2.1.tgz"},"maintainers":[{"email":"dead_horse@qq.com","name":"dead_horse"},{"email":"fengmk2@gmail.com","name":"fengmk2"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-type-of_1.2.1_1537545858466_0.618800985465684"},"_hasShrinkwrap":false,"readme":"is-type-of\n==========\n\nComplete type checking for Node\n\n## Features\n\n- 🔒 Usefull Type Checking，including Primitive, Standard Object, Node Object\n- ✨ Typescript Support\n- 🚪 Typescript Type Guard Support\n\n## Install\n\n```\nnpm install is-type-of\n```\n\n## Usage\n\nUse ES Module import\n\n```typescript\nimport is from 'is-type-of';\nimport { isArray } from 'is-type-of';\n\nisArray([]); // => true\nis.array(); // => true\n```\n\nCompatible With\n\n```javascript\nconst is = require('is-type-of');\n\nis.array([1]); // => true\nis.primitive(true); // => true\nis.primitive({}); // => false\nis.generatorFunction(function * () {}); // => true\nis.long(Math.pow(2, 33)); // => true\nis.double(0); // => false\n```\n\nUse Type Guard\n\n```typescript\nimport { isArray } from 'is-type-of';\n\nfunction checkArray(arr: string[] | string) {\n  // => parameter) arr: string | string[]\n  if (isArray(arr)) {\n    // => (parameter) arr: string[]\n    arr.forEach(console.log);\n  }\n}\n```\n\n\n## API Document\n\n### Primitive\n\n#### isString\n\nReturns true if `val` is string, not `String` object.\n\nSee Also `is.string`\n\n#### isNumber\n\nReturns true if `val` is number, not `Number` object.\n\nSee Also `is.number`\n\n#### isBoolean\n\nReturns true if `val` is boolean, not `Boolean` object.\n\nSee Also `is.boolean`\n\n#### isBigInt\n\nReturns true if `val` is bigint.\n\nSee Also `is.bigInt`\n\n#### isSymbol\n\nReturns true if `val` is symbol.\n\nSee Also `is.symbol`\n\n#### isUndefined\n\nReturns true if `val` is undefined.\n\nSee Also `is.undefined`\n\n#### isNull\n\nReturns true if `val` is null.\n\nSee Also `is.null`\n\n#### isNullable\n\nReturns true if `val` is null or undefined.\n\nSee Also `is.nullable`\n\n#### isPrimitive\n\nReturns true if `val` is primitive.\n\nSee Also `is.primitive`\n\n#### isInteger\n\nReturns true if `val` is integer.\n\nSee Also `is.integer`\n\n#### isInteger32\n\nReturns true if `val` is integer, and between `-2 ** 31` and `2 ** 31 - 1`.\n\nSee Also `is.integer32`\n\n#### isLong\n\nReturns true if `val` is integer, and < `-2 ** 31`, and > `2 ** 31 - 1`.\n\nSee Also `is.long`\n\n#### isSafeInteger\n\nReturns true if `val` is integer, and between `-(2 ** 53 - 1)` and `2 ** 53 - 1`.\n\nSee Also `is.safeInteger`\n\n#### isDouble\n\nReturns true if `val` is Double.\n\nSee Also `is.double`\n\n#### isNaN\n\nReturns true if `val` is NaN.\n\nSee Also `is.NaN`\n\n#### isFinite\n\nReturns true if `val` is finite.\n\nSee Also `is.finite`\n\n### Standard Object\n# API Documentation\n\n#### isArray\n\nReturns true if `val` is array, it won't check items of array.\n\nSee Also `is.array`\n\n#### isFunction\n\nReturns true if `val` is function.\n\nSee Also `is.function`\n\n#### isGeneratorFunction\n\nReturns true if `val` is generator function.\n\nSee Also `is.generatorFunction`\n\n#### isAsyncFunction\n\nReturns true if `val` is async function.\n\nSee Also `is.asyncFunction`\n\n#### isAsyncGeneratorFunction\n\nReturns true if `val` is async generator function.\n\nSee Also `is.asyncGeneratorFunction`\n\n#### isObject\n\nReturns true if `val` is object.\n\nSee Also `is.object`\n\n#### isClass\n\nReturns true if `val` is class.\n\n**Note:** \"class\" is supported in ECMAScript 6, and if the code is using some compiler or transpiler, the checking might fail.\n\nSee Also `is.class`\n\n#### isRegExp\n\nReturns true if `val` is regular expression.\n\nSee Also `is.regExp`\n\n#### isDate\n\nReturns true if `val` is instance of Date.\n\nSee Also `is.date`\n\n#### isError\n\nReturns true if `val` is instance of Error.\n\nSee Also `is.error`\n\n#### isGenerator\n\nReturns true if `val` is generator.\n\nSee Also `is.generator`\n\n#### isPromise\n\nReturns true if `val` is promise.\n\nSee Also `is.promise`\n\n#### isPromiseLike\n\nReturns true if `val` is like promise, if the object has `then` property, the checking will pass.\n\nSee Also `is.promiseLike`\n\n### Node Object\n\n#### isBuffer\n\nReturns true if `val` is buffer.\n\nSee Also `is.buffer`\n\n#### isStream\n\nReturns true if `val` is stream.\n\nSee Also `is.stream`\n\n#### isReadable\n\nReturns true if `val` is readable stream.\n\nSee Also `is.readable`\n\n#### isWritable\n\nReturns true if `val` is write stream.\n\nSee Also `is.writable`\n\n#### isDuplex\n\nReturns true if `val` is duplex stream.\n\nSee Also `is.duplex`\n\n### External Object\n\n#### isLongObject\n\nreturns true if val is LongObject\n\nLongObject is from npm package [long](https://github.com/dcodeIO/long.js)\n\nSee Also `is.longObject`\n\n## Thanks\n\n- [core-util-is](https://github.com/isaacs/core-util-is)\n- [is-stream](https://github.com/rvagg/isstream)\n- [is-class](https://github.com/miguelmota/is-class)\n\n## License\n\nMIT\n","publish_time":1537545858607,"_cnpm_publish_time":1537545858607,"dist-tags":{"latest":"2.2.0","release-1.x":"1.4.0"}}