Travis build: 1293
This commit is contained in:
185
README.md
185
README.md
@ -327,27 +327,20 @@ average(1, 2, 3);
|
||||
<summary>View contents</summary>
|
||||
|
||||
* [`getType`](#gettype)
|
||||
* [`isArray`](#isarray)
|
||||
* [`isArrayBuffer`](#isarraybuffer)
|
||||
* [`is`](#is)
|
||||
* [`isArrayLike`](#isarraylike)
|
||||
* [`isBoolean`](#isboolean)
|
||||
* [`isFunction`](#isfunction)
|
||||
* [`isMap`](#ismap)
|
||||
* [`isNil`](#isnil)
|
||||
* [`isNull`](#isnull)
|
||||
* [`isNumber`](#isnumber)
|
||||
* [`isObject`](#isobject)
|
||||
* [`isPrimitive`](#isprimitive)
|
||||
* [`isPromiseLike`](#ispromiselike)
|
||||
* [`isRegExp`](#isregexp)
|
||||
* [`isSet`](#isset)
|
||||
* [`isString`](#isstring)
|
||||
* [`isSymbol`](#issymbol)
|
||||
* [`isTypedArray`](#istypedarray)
|
||||
* [`isUndefined`](#isundefined)
|
||||
* [`isValidJSON`](#isvalidjson)
|
||||
* [`isWeakMap`](#isweakmap)
|
||||
* [`isWeakSet`](#isweakset)
|
||||
|
||||
</details>
|
||||
|
||||
@ -5264,43 +5257,33 @@ getType(new Set([1, 2, 3])); // 'set'
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isArray
|
||||
### is
|
||||
|
||||
Checks if the given argument is an array.
|
||||
Checks if the provided value is of the specified type (doesn't work with literals).
|
||||
|
||||
Use `Array.isArray()` to check if a value is classified as an array.
|
||||
Use the `instanceof` operator to check if the provided value is of the specified `type`.
|
||||
|
||||
```js
|
||||
const isArray = val => Array.isArray(val);
|
||||
const is = (type, val) => val instanceof type;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isArray([1]); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isArrayBuffer
|
||||
|
||||
Checks if value is classified as a ArrayBuffer object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `ArrayBuffer` object.
|
||||
|
||||
```js
|
||||
const isArrayBuffer = val => val instanceof ArrayBuffer;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isArrayBuffer(new ArrayBuffer()); // true
|
||||
is(Array, [1]); // true
|
||||
is(ArrayBuffer, new ArrayBuffer()); // true
|
||||
is(Map, new Map()); // true
|
||||
is(RegExp, /./g); // true
|
||||
is(Set, new Set()); // true
|
||||
is(WeakMap, new WeakMap()); // true
|
||||
is(WeakSet, new WeakSet()); // true
|
||||
is(String, ''); // false
|
||||
is(String, new String('')); // true
|
||||
is(Number, 1); // false
|
||||
is(Number, new Number(1)); // true
|
||||
is(Boolean, true); // false
|
||||
is(Boolean, new Boolean(true)); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -5384,28 +5367,6 @@ isFunction(x => x); // true
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isMap
|
||||
|
||||
Checks if value is classified as a Map object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `Map` object.
|
||||
|
||||
```js
|
||||
const isMap = val => val instanceof Map;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isMap(new Map()); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isNil
|
||||
|
||||
Returns `true` if the specified value is `null` or `undefined`, `false` otherwise.
|
||||
@ -5562,50 +5523,6 @@ isPromiseLike({}); // false
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isRegExp
|
||||
|
||||
Checks if value is classified as a RegExp object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `RegExp` object.
|
||||
|
||||
```js
|
||||
const isRegExp = val => val instanceof RegExp;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isRegExp(/./g); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isSet
|
||||
|
||||
Checks if value is classified as a Set object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `Set` object.
|
||||
|
||||
```js
|
||||
const isSet = val => val instanceof Set;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isSet(new Set()); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isString
|
||||
|
||||
Checks if the given argument is a string.
|
||||
@ -5650,28 +5567,6 @@ isSymbol(Symbol('x')); // true
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isTypedArray
|
||||
|
||||
Checks if value is classified as a TypedArray object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `TypedArray` object.
|
||||
|
||||
```js
|
||||
const isTypedArray = val => val instanceof TypedArray;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isTypedArray(new TypedArray()); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isUndefined
|
||||
|
||||
Returns `true` if the specified value is `undefined`, `false` otherwise.
|
||||
@ -5724,50 +5619,6 @@ isValidJSON(null); // true
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isWeakMap
|
||||
|
||||
Checks if value is classified as a WeakMap object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `WeakMap` object.
|
||||
|
||||
```js
|
||||
const isWeakMap = val => val instanceof WeakMap;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isWeakMap(new WeakMap()); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isWeakSet
|
||||
|
||||
Checks if value is classified as a WeakSet object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `WeakSet` object.
|
||||
|
||||
```js
|
||||
const isWeakSet = val => val instanceof WeakSet;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isWeakSet(new WeakSet()); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
---
|
||||
## 🔧 Utility
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ const is = (type, val) => val instanceof type;
|
||||
```
|
||||
|
||||
```js
|
||||
is(Array,[1]); // true
|
||||
is(Array, [1]); // true
|
||||
is(ArrayBuffer, new ArrayBuffer()); // true
|
||||
is(Map, new Map()); // true
|
||||
is(RegExp, /./g); // true
|
||||
|
||||
Reference in New Issue
Block a user