UNPKG

3.65 kBMarkdownView Raw
1# is <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
2
3[![Build Status][travis-svg]][travis-url]
4[![dependency status][deps-svg]][deps-url]
5[![dev dependency status][dev-deps-svg]][dev-deps-url]
6[![License][license-image]][license-url]
7[![Downloads][downloads-image]][downloads-url]
8
9[![npm badge][npm-badge-png]][npm-url]
10
11[![browser support][testling-png]][testling-url]
12
13The definitive JavaScript type testing library
14
15To be or not to be? This is the library!
16
17## Installation
18
19As a node.js module
20
21```shell
22$ npm install is
23```
24
25As a component
26```shell
27$ component install enricomarino/is
28```
29
30## API
31
32### general
33
34 - ``is.a`` (value, type) or ``is.type`` (value, type)
35 - ``is.defined`` (value)
36 - ``is.empty`` (value)
37 - ``is.equal`` (value, other)
38 - ``is.hosted`` (value, host)
39 - ``is.instance`` (value, constructor)
40 - ``is.instanceof`` (value, constructor) - deprecated, because in ES3 browsers, "instanceof" is a reserved word
41 - ``is.nil`` (value)
42 - ``is.null`` (value) - deprecated, because in ES3 browsers, "null" is a reserved word
43 - ``is.undef`` (value)
44 - ``is.undefined`` (value) - deprecated, because in ES3 browsers, "undefined" is a reserved word
45
46### arguments
47
48 - ``is.args`` (value)
49 - ``is.arguments`` (value) - deprecated, because "arguments" is a reserved word
50 - ``is.args.empty`` (value)
51
52### array
53
54 - ``is.array`` (value)
55 - ``is.array.empty`` (value)
56 - ``is.arraylike`` (value)
57
58### boolean
59
60 - ``is.bool`` (value)
61 - ``is.boolean`` (value) - deprecated, because in ES3 browsers, "boolean" is a reserved word
62 - ``is.false`` (value) - deprecated, because in ES3 browsers, "false" is a reserved word
63 - ``is.true`` (value) - deprecated, because in ES3 browsers, "true" is a reserved word
64
65### date
66
67 - ``is.date`` (value)
68
69### element
70
71 - ``is.element`` (value)
72
73### error
74
75 - ``is.error`` (value)
76
77### function
78
79 - ``is.fn`` (value)
80 - ``is.function`` (value) - deprecated, because in ES3 browsers, "function" is a reserved word
81
82### number
83
84 - ``is.number`` (value)
85 - ``is.infinite`` (value)
86 - ``is.decimal`` (value)
87 - ``is.divisibleBy`` (value, n)
88 - ``is.integer`` (value)
89 - ``is.int`` (value) - deprecated, because in ES3 browsers, "int" is a reserved word
90 - ``is.maximum`` (value, others)
91 - ``is.minimum`` (value, others)
92 - ``is.nan`` (value)
93 - ``is.even`` (value)
94 - ``is.odd`` (value)
95 - ``is.ge`` (value, other)
96 - ``is.gt`` (value, other)
97 - ``is.le`` (value, other)
98 - ``is.lt`` (value, other)
99 - ``is.within`` (value, start, finish)
100
101### object
102
103 - ``is.object`` (value)
104
105### regexp
106
107 - ``is.regexp`` (value)
108
109### string
110
111 - ``is.string`` (value)
112
113### encoded binary
114
115 - ``is.base64`` (value)
116 - ``is.hex`` (value)
117
118### Symbols
119 - ``is.symbol`` (value)
120
121### BigInts
122 - ``is.bigint`` (value)
123
124## Contributors
125
126- [Jordan Harband](https://github.com/ljharb)
127
128[npm-url]: https://npmjs.org/package/is
129[npm-version-svg]: http://versionbadg.es/enricomarino/is.svg
130[travis-svg]: https://travis-ci.org/enricomarino/is.svg
131[travis-url]: https://travis-ci.org/enricomarino/is
132[deps-svg]: https://david-dm.org/enricomarino/is.svg
133[deps-url]: https://david-dm.org/enricomarino/is
134[dev-deps-svg]: https://david-dm.org/enricomarino/is/dev-status.svg
135[dev-deps-url]: https://david-dm.org/enricomarino/is#info=devDependencies
136[testling-png]: https://ci.testling.com/enricomarino/is.png
137[testling-url]: https://ci.testling.com/enricomarino/is
138[npm-badge-png]: https://nodei.co/npm/is.png?downloads=true&stars=true
139[license-image]: http://img.shields.io/npm/l/is.svg
140[license-url]: LICENSE.md
141[downloads-image]: http://img.shields.io/npm/dm/is.svg
142[downloads-url]: http://npm-stat.com/charts.html?package=is