{"name":"is-type-of","version":"2.0.0","description":"complete type checking for node","main":"dist/index.js","typings":"dist/index.d.ts","scripts":{"prepublishOnly":"npm run tsc:clean && npm run tsc:prod","tsc":"tsc -b ./tsconfig.json","tsc:prod":"tsc -b ./tsconfig.prod.json","tsc:clean":"tsc -b --clean","test":"egg-bin test","ci":"npm run lint && egg-bin cov","lint":"eslint . --ext .ts"},"repository":{"type":"git","url":"git://github.com/node-modules/is-type-of.git"},"node":{"engines":">= 16.0.0"},"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","devDependencies":{"@eggjs/tsconfig":"^1.3.3","@types/mocha":"^10.0.1","@types/node":"^18.16.3","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^6.4.0","eslint":"^8.45.0","eslint-config-egg":"^12.2.1","long":"^3.2.0","semver":"^5.4.1","ts-expect":"^1.3.0","typescript":"^5.1.6"},"gitHead":"96b5b4e436b6ab33568510e8dc9dab9ce4a891a6","_id":"is-type-of@2.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-niUvWpKFeXsOeWFtD/kgVOU9NcpxBDOZtqWeIF0i68ozukswrCsjLdY0EP6QK+/TH76QGlPD4MIyx/ZogQa6lQ==","shasum":"e57c66419ed96d8918cc1cddf912228e0f6804bb","tarball":"http://registry-npm.ywwl.com/is-type-of/download/is-type-of-2.0.0.tgz","fileCount":17,"unpackedSize":50260,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC691sN6ir9aifrTSqC34UN5hv8VSoofVrHxFW9Z2tqwQIgLBMBVbjteyHolg2UbzwG++LrNg2a2XqrtM5nuF/lheY="}],"size":11654,"noattachment":false,"key":"/is-type-of/-/is-type-of-2.0.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-type-of_2.0.0_1690556443106_0.8154766909004383"},"_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":1690556443240,"_cnpm_publish_time":1690556443240,"dist-tags":{"latest":"2.2.0","release-1.x":"1.4.0"}}