You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| is.**numberish**() | _number_ primitive, instance of `Number`
104
-
105
-
_Numberish_ values can be more explicitly tested using the following methods:
26
+
| .type | The type of _value_ (using this module's type names).
27
+
| .of(_class_) | Tests if _value_ was an instance of _class_.
28
+
| .all(_...descriptors)_ | Takes a list of descriptor names as arguments. Returns `true` if **all** of them applied to _value_.
29
+
| .any(_...descriptors_) | Takes a list of descriptor names as arguments. Returns `true` if **any** of them applied to _value_.
30
+
| \[[_descriptor_](#type-names-and-related-descriptors)\] | Descriptors are listed in the table below. Each descriptor property is a boolean that is `true` if it applied to _value_.
31
+
32
+
Enumerable properties of the **is** function are string values of the name of each descriptor. These can be used
33
+
in the `.all()` and `.any()` methods instead of string literals.
34
+
For example, `is(_value_).all("number", "object")` is equivalent to `is(_value_).all(is.number, is.object)`.
35
+
36
+
37
+
## Type Names and Related Descriptors
38
+
39
+
| Descriptor | Type Name | Primitive Values | Instances Of Classes
| is.**number**() | real numbers, `Infinity`, `-Infinity`
112
-
| is.**nan**() | `NaN`
113
74
114
75
Note that JavaScript doesn't always treat mathematical expressions of undefined or indeterminate form as you might expect. For example, `1/0` is an undefined form, but JavaScript evaluates it as `Infinity`.
115
-
116
-
### Text
117
-
118
-
| Method | Tests for
119
-
| - | -
120
-
| is.**regex**() | instance of `RegExp`
121
-
| is.**string**() | _string_ primitive, instance of `String`
122
-
123
-
### Collections
124
-
125
-
| Method | Tests for
126
-
| - | -
127
-
| is.**array**() | instance of `Array`
128
-
| is.**map**() | instance of `Map`
129
-
| is.**set**() | instance of `Set`
130
-
| is.**weakmap**() | instance of `WeakMap`
131
-
| is.**weakset**() | instance of `WeakSet`
132
-
133
-
### Other Common Types
134
-
135
-
| Method | Tests for
136
-
| - | -
137
-
| is.**error**() | instance of `Error`
138
-
| is.**promise**() | instance of `Promise`
139
-
| is.**symbol**() | _symbol_ primitive
140
-
141
-
142
-
## Additional Methods
143
-
144
-
| Method | Description
145
-
| - | -
146
-
| is.**empty**(_value_) | Tests for an empty _string_ primitive or if an object's `.length` or `.size` property equals zero.
147
-
| is.**of**(_value_, _class_) | Tests if _value_ is an instance of _class_. (Same as using the `instanceof` operator.)
* Determine the type of a value. The returned object includes boolean properties to quickly test against specific types or for specific states (e.g., 'empty').
0 commit comments