Travis build: 728 [ci skip]

This commit is contained in:
Travis CI
2017-12-31 13:08:25 +00:00
parent f5dc73e29a
commit d9b3430630
2 changed files with 85 additions and 85 deletions

126
README.md
View File

@ -244,12 +244,14 @@
* [`getType`](#gettype)
* [`hexToRGB`](#hextorgb)
* [`isArray`](#isarray)
* [`isArrayLike`](#isarraylike)
* [`isBoolean`](#isboolean)
* [`isFunction`](#isfunction)
* [`isNull`](#isnull)
* [`isNumber`](#isnumber)
* [`isString`](#isstring)
* [`isSymbol`](#issymbol)
* [`isValidJSON`](#isvalidjson)
* [`randomHexColorCode`](#randomhexcolorcode)
* [`RGBToHex`](#rgbtohex)
* [`sdbm`](#sdbm)
@ -261,16 +263,6 @@
</details>
### _Uncategorized_
<details>
<summary>View contents</summary>
* [`isArrayLike`](#isarraylike)
* [`isValidJSON`](#isvalidjson)
</details>
---
## 🔌 Adapter
@ -4057,6 +4049,37 @@ isArray([1]); // true
<br>[⬆ Back to top](#table-of-contents)
### isArrayLike
Checks if the provided argument is array-like (i.e. is iterable).
Use `Array.from()` and a `try... catch` block to check if the provided argument is array-like.
```js
const isArrayLike = arr => {
try {
Array.from(arr);
return true;
} catch (e) {
return false;
}
};
```
<details>
<summary>Examples</summary>
```js
isArrayLike(document.querySelector('.className')); // true
isArrayLike('abc'); // true
isArrayLike(null); // false
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### isBoolean
Checks if the given argument is a native boolean element.
@ -4194,6 +4217,36 @@ isSymbol(Symbol('x')); // true
<br>[⬆ Back to top](#table-of-contents)
### isValidJSON
Checks if the provided argument is a valid JSON.
Use `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON.
```js
const isValidJSON = obj => {
try {
JSON.parse(obj);
return true;
} catch (e) {
return false;
}
};
```
<details>
<summary>Examples</summary>
```js
isValidJSON('{"name":"Adam","age":20}'); // true
isValidJSON('{"name":"Adam",age:"20"}'); // false
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### randomHexColorCode
Generates a random hexadecimal color code.
@ -4404,59 +4457,6 @@ yesNo('Foo', true); // true
<br>[⬆ Back to top](#table-of-contents)
---
## _Uncategorized_
### isArrayLike
Checks if the provided argument is array-like (i.e. is iterable).
Use `Array.from()` and a `try... catch` block to check if the provided argument is array-like.
```js
const isArrayLike = arr => {
try {
Array.from(arr);
return true;
} catch (e) {
return false;
}
};
```
```js
isArrayLike(document.querySelector('.className')); // true
isArrayLike('abc'); // true
isArrayLike(null); // false
```
<br>[⬆ back to top](#table-of-contents)
### isValidJSON
Checks if the provided argument is a valid JSON.
Use `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON.
```js
const isValidJSON = obj => {
try {
JSON.parse(obj);
return true;
} catch (e) {
return false;
}
};
```
```js
isValidJSON('{"name":"Adam","age":20}'); // true
isValidJSON('{"name":"Adam",age:"20"}'); // false
```
<br>[⬆ back to top](#table-of-contents)
## Collaborators

File diff suppressed because one or more lines are too long