Travis build: 1683

This commit is contained in:
30secondsofcode
2018-02-16 11:46:02 +00:00
parent e2acba21cb
commit 0549931ec6
2 changed files with 22 additions and 88 deletions

View File

@ -99,9 +99,7 @@ average(1, 2, 3);
<summary>View contents</summary>
* [`all`](#all)
* [`allBy`](#allby)
* [`any`](#any)
* [`anyBy`](#anyby)
* [`bifurcate`](#bifurcate)
* [`bifurcateBy`](#bifurcateby)
* [`chunk`](#chunk)
@ -141,7 +139,6 @@ average(1, 2, 3);
* [`maxN`](#maxn)
* [`minN`](#minn)
* [`none`](#none)
* [`noneBy`](#noneby)
* [`nthElement`](#nthelement)
* [`partition`](#partition)
* [`pull`](#pull)
@ -776,41 +773,21 @@ const unary = fn => val => fn(val);
### all
Returns `true` if all elements in a collection are truthy, `false` otherwise.
Use `Array.every(Boolean)` to test if all elements in the collection are truthy.
```js
const all = arr => arr.every(Boolean);
```
<details>
<summary>Examples</summary>
```js
all([1, 2, 3]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### allBy
Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise.
Use `Array.every()` to test if all elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const allBy = (arr, fn) => arr.every(fn);
const all = (arr, fn = Boolean) => arr.every(fn);
```
<details>
<summary>Examples</summary>
```js
allBy([4, 2, 3], x => x > 1); // true
all([4, 2, 3], x => x > 1); // true
all([1, 2, 3]); // true
```
</details>
@ -820,41 +797,21 @@ allBy([4, 2, 3], x => x > 1); // true
### any
Returns `true` if at least one element in a collection is truthy, `false` otherwise.
Use `Array.some(Boolean)` to test if any elements in the collection are truthy.
```js
const any = arr => arr.some(Boolean);
```
<details>
<summary>Examples</summary>
```js
any([0, 0, 1, 0]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### anyBy
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const anyBy = (arr, fn) => arr.some(fn);
const any = (arr, fn = Boolean) => arr.some(fn);
```
<details>
<summary>Examples</summary>
```js
anyBy([0, 1, 2, 0], x => x >= 2); // true
any([0, 1, 2, 0], x => x >= 2); // true
any([0, 0, 1, 0]); // true
```
</details>
@ -1815,41 +1772,21 @@ minN([1, 2, 3], 2); // [1,2]
### none
Returns `true` if no elements in a collection are truthy, `false` otherwise.
Use `!Array.some(Boolean)` to test if any elements in the collection are truthy.
```js
const none = arr => !arr.some(Boolean);
```
<details>
<summary>Examples</summary>
```js
none([0, 0, 0]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### noneBy
Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const noneBy = (arr, fn) => !arr.some(fn);
const none = (arr, fn = Boolean) => !arr.some(fn);
```
<details>
<summary>Examples</summary>
```js
noneBy([0, 1, 3, 0], x => x == 2); // true
none([0, 1, 3, 0], x => x == 2); // true
none([0, 0, 0]); // true
```
</details>

File diff suppressed because one or more lines are too long