{"name":"typical","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"2.3.2","description":"For type-checking Javascript values.","repository":{"type":"git","url":"git+https://github.com/75lb/typical.git"},"main":"./lib/typical.js","license":"MIT","keywords":["type","checking","check","value","valid"],"scripts":{"test":"tape test/*.js","docs":"jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo"},"devDependencies":{"jsdoc-to-markdown":"^1.1","tape":"^4"},"gitHead":"4b0310d6cb9d3bc47c7f44d7c1ce7c00788e4d4b","bugs":{"url":"https://github.com/75lb/typical/issues"},"homepage":"https://github.com/75lb/typical#readme","_id":"typical@2.3.2","_shasum":"661baf5bc0089d547bc10e532a2737b6e34c27e4","_from":".","_npmVersion":"2.14.6","_nodeVersion":"4.1.2","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"661baf5bc0089d547bc10e532a2737b6e34c27e4","tarball":"http://registry-npm.ywwl.com/typical/download/typical-2.3.2.tgz","integrity":"sha512-eSVzqOoHD4P1zevTQgFosL0PAQO+mh053mp8+zw8VGGLVovd/XEAY/hKfCIuIFJBU9uesxSTgbdqH+EcK3hOsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzVIQqtUq8Q2joc6Kj6/8/mv8jba6eQgjs+bfNkLpP7QIhALLAL9/ZILwKK+qsALDPUuvjYfDJ0Gcah9brtEvUuGun"}],"size":2996,"noattachment":false,"key":"/typical/-/typical-2.3.2.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"readme":"head\n\n[![view on npm](https://badgen.net/npm/v/typical)](https://www.npmjs.org/package/typical)\n[![npm module downloads](https://badgen.net/npm/dt/typical)](https://www.npmjs.org/package/typical)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/typical)](https://github.com/75lb/typical/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/typical)](https://github.com/75lb/typical/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/typical/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/typical/actions/workflows/node.js.yml)\n[![Coverage Status](https://coveralls.io/repos/github/75lb/typical/badge.svg)](https://coveralls.io/github/75lb/typical)\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n<a name=\"module_typical\"></a>\n\n## typical\nIsomorphic, functional type-checking for Javascript.\n\n**Example**  \n```js\nimport * as t from 'typical'\nconst allDefined = array.every(t.isDefined)\n```\n\n* [typical](#module_typical)\n    * [.isNumber(n)](#module_typical.isNumber) ⇒ <code>boolean</code>\n    * [.isFiniteNumber(n)](#module_typical.isFiniteNumber) ⇒ <code>boolean</code>\n    * [.isPlainObject(input)](#module_typical.isPlainObject) ⇒ <code>boolean</code>\n    * [.isArrayLike(input)](#module_typical.isArrayLike) ⇒ <code>boolean</code>\n    * [.isObject(input)](#module_typical.isObject) ⇒ <code>boolean</code>\n    * [.isDefined(input)](#module_typical.isDefined) ⇒ <code>boolean</code>\n    * [.isUndefined(input)](#module_typical.isUndefined) ⇒ <code>boolean</code>\n    * [.isNull(input)](#module_typical.isNull) ⇒ <code>boolean</code>\n    * [.isDefinedValue(input)](#module_typical.isDefinedValue) ⇒ <code>boolean</code>\n    * [.isClass(input)](#module_typical.isClass) ⇒ <code>boolean</code>\n    * [.isPrimitive(input)](#module_typical.isPrimitive) ⇒ <code>boolean</code>\n    * [.isPromise(input)](#module_typical.isPromise) ⇒ <code>boolean</code>\n    * [.isIterable(input)](#module_typical.isIterable) ⇒ <code>boolean</code>\n    * [.isString(input)](#module_typical.isString) ⇒ <code>boolean</code>\n    * [.isFunction(input)](#module_typical.isFunction) ⇒ <code>boolean</code>\n\n<a name=\"module_typical.isNumber\"></a>\n\n### t.isNumber(n) ⇒ <code>boolean</code>\nReturns true if input is a number (including infinity). It is a more reasonable alternative to `typeof n` which returns `number` for `NaN`.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n**Returns**: <code>boolean</code> - `true` if input is a number  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| n | <code>\\*</code> | The input to test |\n\n**Example**  \n```js\n> t.isNumber(0)\ntrue\n> t.isNumber(1)\ntrue\n> t.isNumber(1.1)\ntrue\n> t.isNumber(0xff)\ntrue\n> t.isNumber(0644)\ntrue\n> t.isNumber(6.2e5)\ntrue\n> t.isNumber(NaN)\nfalse\n> t.isNumber(Infinity)\ntrue\n```\n<a name=\"module_typical.isFiniteNumber\"></a>\n\n### t.isFiniteNumber(n) ⇒ <code>boolean</code>\nReturns true if input is a finite number. Identical to `isNumber` beside excluding infinity.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| n | <code>\\*</code> | The input to test |\n\n**Example**  \n```js\n> t.isFiniteNumber(0)\ntrue\n> t.isFiniteNumber(1)\ntrue\n> t.isFiniteNumber(1.1)\ntrue\n> t.isFiniteNumber(0xff)\ntrue\n> t.isFiniteNumber(0644)\ntrue\n> t.isFiniteNumber(6.2e5)\ntrue\n> t.isFiniteNumber(NaN)\nfalse\n> t.isFiniteNumber(Infinity)\nfalse\n```\n<a name=\"module_typical.isPlainObject\"></a>\n\n### t.isPlainObject(input) ⇒ <code>boolean</code>\nA plain object is a simple object literal, it is not an instance of a class. Returns true if the input `typeof` is `object` and directly decends from `Object`.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n**Example**  \n```js\n> t.isPlainObject({ something: 'one' })\ntrue\n> t.isPlainObject(new Date())\nfalse\n> t.isPlainObject([ 0, 1 ])\nfalse\n> t.isPlainObject(/test/)\nfalse\n> t.isPlainObject(1)\nfalse\n> t.isPlainObject('one')\nfalse\n> t.isPlainObject(null)\nfalse\n> t.isPlainObject((function * () {})())\nfalse\n> t.isPlainObject(function * () {})\nfalse\n```\n<a name=\"module_typical.isArrayLike\"></a>\n\n### t.isArrayLike(input) ⇒ <code>boolean</code>\nAn array-like value has all the properties of an array yet is not an array instance. An example is the `arguments` object. Returns `true`` if the input value is an object, not `null`` and has a `length` property set with a numeric value.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n**Example**  \n```js\nfunction sum(x, y){\n  console.log(t.isArrayLike(arguments))\n  // prints `true`\n}\n```\n<a name=\"module_typical.isObject\"></a>\n\n### t.isObject(input) ⇒ <code>boolean</code>\nReturns true if the typeof input is `'object'` but not null.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isDefined\"></a>\n\n### t.isDefined(input) ⇒ <code>boolean</code>\nReturns true if the input value is defined.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isUndefined\"></a>\n\n### t.isUndefined(input) ⇒ <code>boolean</code>\nReturns true if the input value is undefined.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isNull\"></a>\n\n### t.isNull(input) ⇒ <code>boolean</code>\nReturns true if the input value is null.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isDefinedValue\"></a>\n\n### t.isDefinedValue(input) ⇒ <code>boolean</code>\nReturns true if the input value is not one of `undefined`, `null`, or `NaN`.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isClass\"></a>\n\n### t.isClass(input) ⇒ <code>boolean</code>\nReturns true if the input value is an ES2015 `class`.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isPrimitive\"></a>\n\n### t.isPrimitive(input) ⇒ <code>boolean</code>\nReturns true if the input is a string, number, symbol, boolean, null or undefined value.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isPromise\"></a>\n\n### t.isPromise(input) ⇒ <code>boolean</code>\nReturns true if the input is a Promise.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isIterable\"></a>\n\n### t.isIterable(input) ⇒ <code>boolean</code>\nReturns true if the input is an iterable (`Map`, `Set`, `Array`, Generator etc.).\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n**Example**  \n```js\n> t.isIterable('string')\ntrue\n> t.isIterable(new Map())\ntrue\n> t.isIterable([])\ntrue\n> t.isIterable((function * () {})())\ntrue\n> t.isIterable(Promise.resolve())\nfalse\n> t.isIterable(Promise)\nfalse\n> t.isIterable(true)\nfalse\n> t.isIterable({})\nfalse\n> t.isIterable(0)\nfalse\n> t.isIterable(1.1)\nfalse\n> t.isIterable(NaN)\nfalse\n> t.isIterable(Infinity)\nfalse\n> t.isIterable(function () {})\nfalse\n> t.isIterable(Date)\nfalse\n> t.isIterable()\nfalse\n> t.isIterable({ then: function () {} })\nfalse\n```\n<a name=\"module_typical.isString\"></a>\n\n### t.isString(input) ⇒ <code>boolean</code>\nReturns true if the input value is a string. The equivalent of `typeof input === 'string'` for use in funcitonal contexts.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n<a name=\"module_typical.isFunction\"></a>\n\n### t.isFunction(input) ⇒ <code>boolean</code>\nReturns true if the input value is a function. The equivalent of `typeof input === 'function'` for use in funcitonal contexts.\n\n**Kind**: static method of [<code>typical</code>](#module_typical)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>\\*</code> | The input to test |\n\n\n## Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nWithin a Node.js ECMAScript Module:\n\n```js\nimport * as typical from 'typical'\n```\n\nor\n\n```js\nimport { isNumber } from 'typical'\n```\n\nWithin a modern browser ECMAScript Module:\n\n```js\nimport typical from './node_modules/typical/index.mjs'\n```\n\n* * *\n\n&copy; 2014-21 Lloyd Brookes \\<75pound@gmail.com\\>.\n\nIsomorphic test suite by [test-runner](https://github.com/test-runner-js/test-runner) and [web-runner](https://github.com/test-runner-js/web-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1444346197421,"_cnpm_publish_time":1444346197421,"dist-tags":{"latest":"8.0.0"}}