{"name":"typical","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"7.1.0","description":"Isomorphic, functional type-checking for Javascript","repository":{"type":"git","url":"git+https://github.com/75lb/typical.git"},"license":"MIT","type":"module","exports":"./index.js","keywords":["type","checking","check","value","valid","is","number","object","plainobject","array","like","defined","string","boolean","function","promise","iterable","class","primitive","isstring","isclass","isiterable","isdefined","isobject","isomorphic"],"engines":{"node":">=12.17"},"scripts":{"test":"npm run test:cli && npm run test:web","test:cli":"test-runner test/*.js","test:web":"web-runner test/test.js","docs":"jsdoc2md -c jsdoc.conf -t README.hbs index.js > README.md","cover":"c8 npm test && c8 report --reporter=text-lcov | coveralls"},"devDependencies":{"@test-runner/web":"^0.4.4","c8":"^7.8.0","coveralls":"^3.1.1","isomorphic-assert":"^1.0.0","jsdoc-to-markdown":"^7.0.1","rollup":"^2.56.2","test-object-model":"^0.7.1"},"gitHead":"c32b7cf6a6337332510c61629802bca1815550af","bugs":{"url":"https://github.com/75lb/typical/issues"},"homepage":"https://github.com/75lb/typical#readme","_id":"typical@7.1.0","_nodeVersion":"16.6.2","_npmVersion":"7.20.6","dist":{"integrity":"sha512-o0UQ/D8ChD+1EIVqOkjcWs7WoWb4zgZJqq6Id7gAFAWF8JNbeCJRN8l3ACp4O2RZLWBqqQac4+sbPzFZaX6pVw==","shasum":"cf7a0c2694f2ac38e1283f054a7c08c75a2990f1","tarball":"http://registry-npm.ywwl.com/typical/download/typical-7.1.0.tgz","fileCount":4,"unpackedSize":13883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGjUmCRA9TVsSAnZWagAAkfIP/iAjbirFJ8rpcqta71Td\ne3YTzbm7Yw81bZnAjBtEkLHtBqNun/0Y2Lw0X5xaNhYr+W1mDM9WxAStT91b\nzby4dii4TfIzhPbnH0htvKvH8EdZ6GmkUROBdShQ4J/AaebsSEBdCY+M4rc6\nvbKpgTwW/CiVEVT6W7ZkudZZXxjju26uysIeTtm/ttFcpxfOP/1IDO0axV1K\nGQgUH7NJ/cjI31dgQUugeo2/IxJ1Sboggf1VgsnpYp8Khocjw7to13i/LyYJ\nUN291iA8otvxzXWNFIqg02VXEvhVsCiBtyA8JiiHBLbWBf/um+pcjD5KGm7Y\nHreMygWhg7wmrcDkkON6V1qp6w9q66RyC8YiEDHE5Zm8USHsq2v6rA73RvqH\ne6sQUoJGLjqKY6x6YBI+AQxkcRl6BhKUwN/oSj1GfqCcjQOXr5N9ov5IqPEG\nEPFz+VOUhp+ipBXZYOQ6+JiKPa7OZCj2QgqvHlCbWVJ5cPCYb1kURfCMnWGf\nPAyRONWY0e79qTCjbSflskGuvJ/dZkGciF49d7hCItFXs8bly4Wf2slVQLNm\n6LJv/wSOng1sSD0utrmgDWsbaRqZaxI72uhAqVTDS6t//S2uM6qeJvf1L3ZB\nSFxRnCflaStnOglfFwm/e05kby2P34NV8Q34BLNTET6YeYyQU+F9xg1HWb7u\nM5/U\r\n=lfLH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLQnaGX6/7Bq2rVNJxqDUQGaud9pv/XaycqfAzWYo5lwIgWJgJ4dux3NJCvuZrXjmrV4lYEz5sox6itSbJYCDxMAQ="}],"size":3308,"noattachment":false,"key":"/typical/-/typical-7.1.0.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typical_7.1.0_1629107494612_0.18340556372363515"},"_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":1629107494745,"_cnpm_publish_time":1629107494745,"dist-tags":{"latest":"8.0.0"}}