{"name":"typical","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"3.0.0","description":"Robust Javascript type-checking","repository":{"type":"git","url":"git+https://github.com/75lb/typical.git"},"license":"MIT","keywords":["type","checking","check","value","valid","is","number","object","plainobject","array","like","defined","string","boolean","function","promise","iterable","class","primitive"],"engines":{"node":">=6"},"scripts":{"test":"test-runner test.js","docs":"jsdoc2md -t README.hbs index.js > README.md; echo","cover":"nyc --reporter=text-lcov test-runner test.js | coveralls"},"devDependencies":{"coveralls":"^3.0.2","jsdoc-to-markdown":"^4.0.1","test-runner":"^0.5.0"},"gitHead":"cee19519fadf276ba190e9543ead7695ebb119dc","bugs":{"url":"https://github.com/75lb/typical/issues"},"homepage":"https://github.com/75lb/typical#readme","_id":"typical@3.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"integrity":"sha512-2/pGDQD/q1iJWlrj357aEKGIlRvHirm81x04lsg51hreiohy2snAXoFc9dIHFWEx9LsfOVA5K7lUGM9rcUqwlQ==","shasum":"90ff7c207fabf8b63258b76efdade39cfc9ff36f","tarball":"http://registry-npm.ywwl.com/typical/download/typical-3.0.0.tgz","fileCount":8,"unpackedSize":20388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbS6isCRA9TVsSAnZWagAAd40P/1TIDR+tCxGMFYZ+ve/q\nky19KwI5xv5XghTgFsfm5HYI5Wsb8sb3rDylULCpk+naVlLNl/jbezgr4iLG\n22fdT7++IsPZk+D2s873znncoX1WuYkWyBFS8WNtQVSYkavonubx57uAsjnI\nN9sobUzpryP4pMlv4VZD/LNbmYkYjlVyluiHAM1ikKgUpyed4IN4dGdauKM3\naKPId91W5BW8wUP0wL63KjecaA5MxJc6Frhk4H/Rxgo3DcFE9pM0nf5938nI\nZ392ngBRMXTftaGGldRhd+YnqtqgeBT4qW0x8dWTELlni50yH+o1zQFHfHJU\ny6N4KOXxEU4kXd3M9mknC2JEjjQNN7G69arWSY055DnCA4A2DtYZii/ODdl9\nez0OIFQxUAzH9U2D2mgA3feeyi+yJXGlL/P2KB2qsujfAfKVMaVMTqQiZa85\nWCGoMwRfg1KOXoel34mHYFsceJTQp5Q713FjQrZ0TJEnfsBj8bvXYk78yo+c\nKQif3lCt7lK+1omsmNWAjvMzqQ4FxHxwOw3sjG1FhdygY2iWxnxK7+u+TD9q\nuYVxQYgoJZxqvs/lkeD17jOYLfT9Qb2t+SaT3Xx8/VaOZCu0sm1Vnc3vUKg2\nC64/nk3dNIn04v9yPAV56gfmdsXKA509B09xqBPtYeNs5ywUgqLqGg422Ydj\nkbTI\r\n=3r78\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAV3JbUKvQqcAk1hShDByBKZTFr21QFpAJF5cUSkVpnmAiAT5PquLaEhpYhdCZ3j7Bp4Gqy6FrfEyeDA845YCznZLQ=="}],"size":4297,"noattachment":false,"key":"/typical/-/typical-3.0.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typical_3.0.0_1531685036065_0.02018696978009582"},"_hasShrinkwrap":false,"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":1531685036153,"_cnpm_publish_time":1531685036153,"dist-tags":{"latest":"8.0.0"}}