Travis build: 1061
This commit is contained in:
155
README.md
155
README.md
@ -102,6 +102,7 @@ average(1, 2, 3);
|
|||||||
* [`flattenDepth`](#flattendepth)
|
* [`flattenDepth`](#flattendepth)
|
||||||
* [`groupBy`](#groupby)
|
* [`groupBy`](#groupby)
|
||||||
* [`head`](#head)
|
* [`head`](#head)
|
||||||
|
* [`indexOfAll`](#indexofall)
|
||||||
* [`initial`](#initial)
|
* [`initial`](#initial)
|
||||||
* [`initialize2DArray`](#initialize2darray)
|
* [`initialize2DArray`](#initialize2darray)
|
||||||
* [`initializeArrayWithRange`](#initializearraywithrange)
|
* [`initializeArrayWithRange`](#initializearraywithrange)
|
||||||
@ -285,6 +286,8 @@ average(1, 2, 3);
|
|||||||
* [`escapeRegExp`](#escaperegexp)
|
* [`escapeRegExp`](#escaperegexp)
|
||||||
* [`fromCamelCase`](#fromcamelcase)
|
* [`fromCamelCase`](#fromcamelcase)
|
||||||
* [`isAbsoluteURL`](#isabsoluteurl)
|
* [`isAbsoluteURL`](#isabsoluteurl)
|
||||||
|
* [`isLowerCase`](#islowercase)
|
||||||
|
* [`isUpperCase`](#isuppercase)
|
||||||
* [`mask`](#mask)
|
* [`mask`](#mask)
|
||||||
* [`palindrome`](#palindrome)
|
* [`palindrome`](#palindrome)
|
||||||
* [`pluralize`](#pluralize)
|
* [`pluralize`](#pluralize)
|
||||||
@ -342,17 +345,6 @@ average(1, 2, 3);
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### _Uncategorized_
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>View contents</summary>
|
|
||||||
|
|
||||||
* [`indexOfAll`](#indexofall)
|
|
||||||
* [`isLowerCase`](#islowercase)
|
|
||||||
* [`isUpperCase`](#isuppercase)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## 🔌 Adapter
|
## 🔌 Adapter
|
||||||
|
|
||||||
@ -876,6 +868,34 @@ head([1, 2, 3]); // 1
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### indexOfAll
|
||||||
|
|
||||||
|
Returns all indices of `val` in an array. If `val` never occurs, returns `[-1]`.
|
||||||
|
|
||||||
|
Use `Array.forEach()` to loop over elements and `Array.push()` to store indices for matching elements.
|
||||||
|
Return `[-1]` if `length` of the array of indices is `0`, otherwise return the array of indices.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const indexOfAll = (arr, val) => {
|
||||||
|
const indices = [];
|
||||||
|
arr.forEach((el, i) => el === val && indices.push(i));
|
||||||
|
return indices.length ? indices : [-1];
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
indexOfAll([1, 2, 3, 1, 2, 3], 1); // [0,3]
|
||||||
|
indexOfAll([1, 2, 3], 4); // [-1]
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### initial
|
### initial
|
||||||
|
|
||||||
Returns all the elements of an array except the last one.
|
Returns all the elements of an array except the last one.
|
||||||
@ -4119,6 +4139,55 @@ isAbsoluteURL('/foo/bar'); // false
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### isLowerCase
|
||||||
|
|
||||||
|
Checks if a string is lower case.
|
||||||
|
|
||||||
|
Convert the given string to lower case, using `String.toLowerCase()` and compare it to the original.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const isLowerCase = str => str === str.toLowerCase();
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
isLowerCase('abc'); // true
|
||||||
|
isLowerCase('a3@$'); // true
|
||||||
|
isLowerCase('Ab4'); // false
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### isUpperCase
|
||||||
|
|
||||||
|
Checks if a string is upper case.
|
||||||
|
|
||||||
|
Convert the given string to upper case, using `String.toUpperCase()` and compare it to the original.
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
const isUpperCase = str => str === str.toUpperCase();
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
isUpperCase('ABC'); // true
|
||||||
|
isLowerCase('A3@$'); // true
|
||||||
|
isLowerCase('aB4'); // false
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### mask
|
### mask
|
||||||
|
|
||||||
Replaces all but the last `num` of characters with the specified mask character.
|
Replaces all but the last `num` of characters with the specified mask character.
|
||||||
@ -5141,70 +5210,6 @@ yesNo('Foo', true); // true
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
---
|
|
||||||
## _Uncategorized_
|
|
||||||
|
|
||||||
### indexOfAll
|
|
||||||
|
|
||||||
Returns all indices of `val` in an array. If `val` never occurs, returns `[-1]`.
|
|
||||||
|
|
||||||
Use `Array.forEach()` to loop over elements and `Array.push()` to store indices for matching elements.
|
|
||||||
Return `[-1]` if `length` of the array of indices is `0`, otherwise return the array of indices.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const indexOfAll = (arr, val) => {
|
|
||||||
const indices = [];
|
|
||||||
arr.forEach((el, i) => el === val && indices.push(i));
|
|
||||||
return indices.length ? indices : [-1];
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
indexOfAll([1, 2, 3, 1, 2, 3], 1); // [0,3]
|
|
||||||
indexOfAll([1, 2, 3], 4); // [-1]
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>[⬆ back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### isLowerCase
|
|
||||||
|
|
||||||
Checks if a string is lower case.
|
|
||||||
|
|
||||||
Convert the given string to lower case, using `String.toLowerCase()` and compare it to the original.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const isLowerCase = str => str === str.toLowerCase();
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
isLowerCase('abc'); // true
|
|
||||||
isLowerCase('a3@$'); // true
|
|
||||||
isLowerCase('Ab4'); // false
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>[⬆ back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### isUpperCase
|
|
||||||
|
|
||||||
Checks if a string is upper case.
|
|
||||||
|
|
||||||
Convert the given string to upper case, using `String.toUpperCase()` and compare it to the original.
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
const isUpperCase = str => str === str.toUpperCase();
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
isUpperCase('ABC'); // true
|
|
||||||
isLowerCase('A3@$'); // true
|
|
||||||
isLowerCase('aB4'); // false
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>[⬆ back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
## Collaborators
|
## Collaborators
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user