UNPKG

8.23 kBMarkdownView Raw
1<!-- This file is generated - DO NOT EDIT! -->
2<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3# ![@thi.ng/checks](https://media.thi.ng/umbrella/banners-20230807/thing-checks.svg?567a74c6)
4
5[![npm version](https://img.shields.io/npm/v/@thi.ng/checks.svg)](https://www.npmjs.com/package/@thi.ng/checks)
6![npm downloads](https://img.shields.io/npm/dm/@thi.ng/checks.svg)
7[![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
9> [!NOTE]
10> This is one of 201 standalone projects, maintained as part
11> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12> and anti-framework.
13>
14> 🚀 Please help me to work full-time on these projects by [sponsoring me on
15> GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
16
17- [About](#about)
18- [Status](#status)
19- [Installation](#installation)
20- [Dependencies](#dependencies)
21- [API](#api)
22- [Authors](#authors)
23- [License](#license)
24
25## About
26
27Collection of 70+ type, feature & value checks.
28
29- [`exists`](https://docs.thi.ng/umbrella/checks/functions/exists.html)
30- [`existsAndNotNull`](https://docs.thi.ng/umbrella/checks/functions/existsAndNotNull.html)
31- [`hasBigInt`](https://docs.thi.ng/umbrella/checks/functions/hasBigInt.html)
32- [`hasCrypto`](https://docs.thi.ng/umbrella/checks/functions/hasCrypto.html)
33- [`hasMaxLength`](https://docs.thi.ng/umbrella/checks/functions/hasMaxLength.html)
34- [`hasMinLength`](https://docs.thi.ng/umbrella/checks/functions/hasMinLength.html)
35- [`hasPerformance`](https://docs.thi.ng/umbrella/checks/functions/hasPerformance.html)
36- [`hasWASM`](https://docs.thi.ng/umbrella/checks/functions/hasWASM.html)
37- [`hasWebGL`](https://docs.thi.ng/umbrella/checks/functions/hasWebGL.html)
38- [`hasWebSocket`](https://docs.thi.ng/umbrella/checks/functions/hasWebSocket.html)
39- [`implementsFunction`](https://docs.thi.ng/umbrella/checks/functions/implementsFunction.html)
40- [`isASCII`](https://docs.thi.ng/umbrella/checks/functions/isASCII.html)
41- [`isAlpha`](https://docs.thi.ng/umbrella/checks/functions/isAlpha.html)
42- [`isAlphaNum`](https://docs.thi.ng/umbrella/checks/functions/isAlphaNum.html)
43- [`isArray`](https://docs.thi.ng/umbrella/checks/functions/isArray.html)
44- [`isArrayBufferLike`](https://docs.thi.ng/umbrella/checks/functions/isArrayBufferLike.html)
45- [`isArrayBufferView`](https://docs.thi.ng/umbrella/checks/functions/isArrayBufferView.html)
46- [`isArrayLike`](https://docs.thi.ng/umbrella/checks/functions/isArrayLike.html)
47- [`isAsyncIterable`](https://docs.thi.ng/umbrella/checks/functions/isAsyncIterable.html)
48- [`isBigInt`](https://docs.thi.ng/umbrella/checks/functions/isBigInt.html)
49- [`isBlob`](https://docs.thi.ng/umbrella/checks/functions/isBlob.html)
50- [`isBoolean`](https://docs.thi.ng/umbrella/checks/functions/isBoolean.html)
51- [`isChrome`](https://docs.thi.ng/umbrella/checks/functions/isChrome.html)
52- [`isDataURL`](https://docs.thi.ng/umbrella/checks/functions/isDataURL.html)
53- [`isDate`](https://docs.thi.ng/umbrella/checks/functions/isDate.html)
54- [`isEven`](https://docs.thi.ng/umbrella/checks/functions/isEven.html)
55- [`isFalse`](https://docs.thi.ng/umbrella/checks/functions/isFalse.html)
56- [`isFile`](https://docs.thi.ng/umbrella/checks/functions/isFile.html)
57- [`isFirefox`](https://docs.thi.ng/umbrella/checks/functions/isFirefox.html)
58- [`isFloatString`](https://docs.thi.ng/umbrella/checks/functions/isFloatString.html)
59- [`isFunction`](https://docs.thi.ng/umbrella/checks/functions/isFunction.html)
60- [`isGenerator`](https://docs.thi.ng/umbrella/checks/functions/isGenerator.html)
61- [`isHex`](https://docs.thi.ng/umbrella/checks/functions/isHex.html)
62- [`isHexColor`](https://docs.thi.ng/umbrella/checks/functions/isHexColor.html)
63- [`isIE`](https://docs.thi.ng/umbrella/checks/functions/isIE.html)
64- [`isIllegalKey`](https://docs.thi.ng/umbrella/checks/functions/isIllegalKey.html)
65- [`isInRange`](https://docs.thi.ng/umbrella/checks/functions/isInRange.html)
66- [`isInt32`](https://docs.thi.ng/umbrella/checks/functions/isInt32.html)
67- [`isIntString`](https://docs.thi.ng/umbrella/checks/functions/isIntString.html)
68- [`isIterable`](https://docs.thi.ng/umbrella/checks/functions/isIterable.html)
69- [`isMap`](https://docs.thi.ng/umbrella/checks/functions/isMap.html)
70- [`isMobile`](https://docs.thi.ng/umbrella/checks/functions/isMobile.html)
71- [`isNaN`](https://docs.thi.ng/umbrella/checks/functions/isNaN.html)
72- [`isNegative`](https://docs.thi.ng/umbrella/checks/functions/isNegative.html)
73- [`isNil`](https://docs.thi.ng/umbrella/checks/functions/isNil.html)
74- [`isNode`](https://docs.thi.ng/umbrella/checks/functions/isNode.html)
75- [`isNotStringAndIterable`](https://docs.thi.ng/umbrella/checks/functions/isNotStringAndIterable.html)
76- [`isNull`](https://docs.thi.ng/umbrella/checks/functions/isNull.html)
77- [`isNumber`](https://docs.thi.ng/umbrella/checks/functions/isNumber.html)
78- [`isNumeric`](https://docs.thi.ng/umbrella/checks/functions/isNumeric.html)
79- [`isNumericFloat`](https://docs.thi.ng/umbrella/checks/functions/isNumericFloat.html)
80- [`isNumericInt`](https://docs.thi.ng/umbrella/checks/functions/isNumericInt.html)
81- [`isObject`](https://docs.thi.ng/umbrella/checks/functions/isObject.html)
82- [`isOdd`](https://docs.thi.ng/umbrella/checks/functions/isOdd.html)
83- [`isPlainObject`](https://docs.thi.ng/umbrella/checks/functions/isPlainObject.html)
84- [`isPositive`](https://docs.thi.ng/umbrella/checks/functions/isPositive.html)
85- [`isPrimitive`](https://docs.thi.ng/umbrella/checks/functions/isPrimitive.html)
86- [`isPrintableASCII`](https://docs.thi.ng/umbrella/checks/functions/isPrintableASCII.html)
87- [`isPromise`](https://docs.thi.ng/umbrella/checks/functions/isPromise.html)
88- [`isPromiseLike`](https://docs.thi.ng/umbrella/checks/functions/isPromiseLike.html)
89- [`isProtoPath`](https://docs.thi.ng/umbrella/checks/functions/isProtoPath.html)
90- [`isRegExp`](https://docs.thi.ng/umbrella/checks/functions/isRegExp.html)
91- [`isSafari`](https://docs.thi.ng/umbrella/checks/functions/isSafari.html)
92- [`isSet`](https://docs.thi.ng/umbrella/checks/functions/isSet.html)
93- [`isString`](https://docs.thi.ng/umbrella/checks/functions/isString.html)
94- [`isSymbol`](https://docs.thi.ng/umbrella/checks/functions/isSymbol.html)
95- [`isTouchEvent`](https://docs.thi.ng/umbrella/checks/functions/isTouchEvent.html)
96- [`isTransferable`](https://docs.thi.ng/umbrella/checks/functions/isTransferable.html)
97- [`isTrue`](https://docs.thi.ng/umbrella/checks/functions/isTrue.html)
98- [`isTypedArray`](https://docs.thi.ng/umbrella/checks/functions/isTypedArray.html)
99- [`isUUID`](https://docs.thi.ng/umbrella/checks/functions/isUUID.html)
100- [`isUUIDv4`](https://docs.thi.ng/umbrella/checks/functions/isUUIDv4.html)
101- [`isUint32`](https://docs.thi.ng/umbrella/checks/functions/isUint32.html)
102- [`isUndefined`](https://docs.thi.ng/umbrella/checks/functions/isUndefined.html)
103- [`isZero`](https://docs.thi.ng/umbrella/checks/functions/isZero.html)
104
105## Status
106
107**STABLE** - used in production
108
109[Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bchecks%5D+in%3Atitle)
110
111## Installation
112
113```bash
114yarn add @thi.ng/checks
115```
116
117ESM import:
118
119```ts
120import * as ch from "@thi.ng/checks";
121```
122
123Browser ESM import:
124
125```html
126<script type="module" src="https://esm.run/@thi.ng/checks"></script>
127```
128
129[JSDelivr documentation](https://www.jsdelivr.com/)
130
131For Node.js REPL:
132
133```js
134const ch = await import("@thi.ng/checks");
135```
136
137Package sizes (brotli'd, pre-treeshake): ESM: 1.65 KB
138
139## Dependencies
140
141- [tslib](https://www.typescriptlang.org/)
142
143## API
144
145[Generated API docs](https://docs.thi.ng/umbrella/checks/)
146
147TODO
148
149## Authors
150
151- [Karsten Schmidt](https://thi.ng) (Main author)
152- [Gavin Cannizzaro](https://github.com/gavinpc-mindgrub)
153- [Jay Zawrotny](https://github.com/eccentric-j)
154
155If this project contributes to an academic publication, please cite it as:
156
157```bibtex
158@misc{thing-checks,
159 title = "@thi.ng/checks",
160 author = "Karsten Schmidt and others",
161 note = "https://thi.ng/checks",
162 year = 2016
163}
164```
165
166## License
167
168&copy; 2016 - 2025 Karsten Schmidt // Apache License 2.0