Travis build: 1674
This commit is contained in:
138
README.md
138
README.md
@ -98,6 +98,10 @@ average(1, 2, 3);
|
|||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
|
|
||||||
|
* [`all`](#all)
|
||||||
|
* [`allBy`](#allby)
|
||||||
|
* [`any`](#any)
|
||||||
|
* [`anyBy`](#anyby)
|
||||||
* [`bifurcate`](#bifurcate)
|
* [`bifurcate`](#bifurcate)
|
||||||
* [`bifurcateBy`](#bifurcateby)
|
* [`bifurcateBy`](#bifurcateby)
|
||||||
* [`chunk`](#chunk)
|
* [`chunk`](#chunk)
|
||||||
@ -136,6 +140,8 @@ average(1, 2, 3);
|
|||||||
* [`mapObject`](#mapobject-)
|
* [`mapObject`](#mapobject-)
|
||||||
* [`maxN`](#maxn)
|
* [`maxN`](#maxn)
|
||||||
* [`minN`](#minn)
|
* [`minN`](#minn)
|
||||||
|
* [`none`](#none)
|
||||||
|
* [`noneBy`](#noneby)
|
||||||
* [`nthElement`](#nthelement)
|
* [`nthElement`](#nthelement)
|
||||||
* [`partition`](#partition)
|
* [`partition`](#partition)
|
||||||
* [`pull`](#pull)
|
* [`pull`](#pull)
|
||||||
@ -767,6 +773,94 @@ const unary = fn => val => fn(val);
|
|||||||
---
|
---
|
||||||
## 📚 Array
|
## 📚 Array
|
||||||
|
|
||||||
|
### 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`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const allBy = (arr, fn) => arr.every(fn);
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
allBy([4, 2, 3], x => x > 1); // true
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### 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`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const anyBy = (arr, fn) => arr.some(fn);
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
anyBy([0, 1, 2, 0], x => x >= 2); // true
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### bifurcate
|
### bifurcate
|
||||||
|
|
||||||
Splits values into two groups. If an element in `filter` is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.
|
Splits values into two groups. If an element in `filter` is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.
|
||||||
@ -1718,6 +1812,50 @@ minN([1, 2, 3], 2); // [1,2]
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### 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`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const noneBy = (arr, fn) => !arr.some(fn);
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
noneBy([0, 1, 3, 0], x => x == 2); // true
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### nthElement
|
### nthElement
|
||||||
|
|
||||||
Returns the nth element of an array.
|
Returns the nth element of an array.
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -9,5 +9,5 @@ const all = arr => arr.every(Boolean);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
all([1,2,3]); // true
|
all([1, 2, 3]); // true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,5 +9,5 @@ const allBy = (arr, fn) => arr.every(fn);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
allBy([4,2,3], x => x > 1); // true
|
allBy([4, 2, 3], x => x > 1); // true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,5 +9,5 @@ const any = arr => arr.some(Boolean);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
any([0,0,1,0]); // true
|
any([0, 0, 1, 0]); // true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,5 +9,5 @@ const anyBy = (arr, fn) => arr.some(fn);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
anyBy([0,1,2,0], x => x >= 2); // true
|
anyBy([0, 1, 2, 0], x => x >= 2); // true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,5 +9,5 @@ const none = arr => !arr.some(Boolean);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
none([0,0,0]); // true
|
none([0, 0, 0]); // true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -9,5 +9,5 @@ const noneBy = (arr, fn) => !arr.some(fn);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
noneBy([0,1,3,0], x => x == 2); // true
|
noneBy([0, 1, 3, 0], x => x == 2); // true
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user