{"name":"is-type-of","version":"0.2.0","description":"complete type checking for node","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/dead-horse/is-type-of.git"},"files":["index.js"],"keywords":["typeof","checker","type","is"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/dead-horse/is-type-of/issues"},"homepage":"https://github.com/dead-horse/is-type-of","devDependencies":{"autod":"^0.1.1","istanbul":"git://github.com/gotwarlost/istanbul.git#harmony","mocha":"^1.17.1","should":"3.2.0"},"dependencies":{"core-util-is":"1.0.1","isstream":"0.1.0"},"_id":"is-type-of@0.2.0","dist":{"shasum":"1e61eece8c6b9db2c304e3da3641862cb65684ab","tarball":"http://registry-npm.ywwl.com/is-type-of/download/is-type-of-0.2.0.tgz","integrity":"sha512-SLyYOh63LDxNb6PbbEPu8H+KhKOa1UXnLhL+1g6Cu9zIR/rheR/QB59a7CoTOapzq0D4xoZ3WITpD/6yyadiHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAl+kYX83Z0jbYViPzpnxVt/b/vmPFy09h94onv6qwRAAiEAl6+DbRIPv/b6noOGWEzgn0EKcNGdHaNbFZ/KQPMHAuM="}],"size":1499,"noattachment":false,"key":"/is-type-of/-/is-type-of-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"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":1396841819567,"_cnpm_publish_time":1396841819567,"dist-tags":{"latest":"2.2.0","release-1.x":"1.4.0"}}