From 67690e01f968a2e90d8f34a99bc92a1c1eaf0ffe Mon Sep 17 00:00:00 2001
From: 30secondsofcode <30secondsofcode@gmail.com>
Date: Sat, 6 Jan 2018 12:10:41 +0000
Subject: [PATCH] Travis build: 1061
---
README.md | 155 +++++++++++++++++++++++++-----------------------
docs/index.html | 34 +++++------
2 files changed, 97 insertions(+), 92 deletions(-)
diff --git a/README.md b/README.md
index abdfd39a0..79ba0b7b9 100644
--- a/README.md
+++ b/README.md
@@ -102,6 +102,7 @@ average(1, 2, 3);
* [`flattenDepth`](#flattendepth)
* [`groupBy`](#groupby)
* [`head`](#head)
+* [`indexOfAll`](#indexofall)
* [`initial`](#initial)
* [`initialize2DArray`](#initialize2darray)
* [`initializeArrayWithRange`](#initializearraywithrange)
@@ -285,6 +286,8 @@ average(1, 2, 3);
* [`escapeRegExp`](#escaperegexp)
* [`fromCamelCase`](#fromcamelcase)
* [`isAbsoluteURL`](#isabsoluteurl)
+* [`isLowerCase`](#islowercase)
+* [`isUpperCase`](#isuppercase)
* [`mask`](#mask)
* [`palindrome`](#palindrome)
* [`pluralize`](#pluralize)
@@ -342,17 +345,6 @@ average(1, 2, 3);
-### _Uncategorized_
-
-
-View contents
-
-* [`indexOfAll`](#indexofall)
-* [`isLowerCase`](#islowercase)
-* [`isUpperCase`](#isuppercase)
-
-
-
---
## 🔌 Adapter
@@ -876,6 +868,34 @@ head([1, 2, 3]); // 1
[⬆ 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];
+};
+```
+
+
+Examples
+
+```js
+indexOfAll([1, 2, 3, 1, 2, 3], 1); // [0,3]
+indexOfAll([1, 2, 3], 4); // [-1]
+```
+
+
+
+ [⬆ Back to top](#table-of-contents)
+
+
### initial
Returns all the elements of an array except the last one.
@@ -4119,6 +4139,55 @@ isAbsoluteURL('/foo/bar'); // false
[⬆ 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();
+```
+
+
+Examples
+
+```js
+isLowerCase('abc'); // true
+isLowerCase('a3@$'); // true
+isLowerCase('Ab4'); // false
+```
+
+
+
+ [⬆ 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();
+```
+
+
+Examples
+
+```js
+isUpperCase('ABC'); // true
+isLowerCase('A3@$'); // true
+isLowerCase('aB4'); // false
+```
+
+
+
+ [⬆ Back to top](#table-of-contents)
+
+
### mask
Replaces all but the last `num` of characters with the specified mask character.
@@ -5141,70 +5210,6 @@ yesNo('Foo', true); // true
[⬆ 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]
-```
-
- [⬆ 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
-```
-
- [⬆ 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
-```
-
- [⬆ back to top](#table-of-contents)
-
## Collaborators
diff --git a/docs/index.html b/docs/index.html
index eb2d12c09..5eb613a54 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -40,7 +40,7 @@
},1700);
}
}, false);
- }
30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.
Adapter
call
Given a key and a set of arguments, call them when given a context. Primarily useful in composition.
Use a closure to call a stored key with stored arguments.
Use arr[0] to return the first element of the passed array.
consthead= arr => arr[0];
head([1,2,3]);// 1
+
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.
constindexOfAll=(arr, val)=>{
+ const indices =[];
+ arr.forEach((el, i)=> el === val && indices.push(i));
+ return indices.length ? indices : [-1];
+};
+
Replaces all but the last num of characters with the specified mask character.
Use String.slice() to grab the portion of the characters that need to be masked and use String.replace() with a regexp to replace every character with the mask character. Concatenate the masked characters with the remaining unmasked portion of the string. Omit the second argument, num, to keep a default of 4 characters unmasked. If num is negative, the unmasked characters will be at the start of the string. Omit the third argument, mask, to use a default character of '*' for the mask.
const mask =(cc, num =4, mask ='*')=>(''+ cc).slice(0,-num).replace(/./g, mask)+(''+ cc).slice(-num);
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.
constindexOfAll=(arr, val)=>{
- const indices =[];
- arr.forEach((el, i)=> el === val && indices.push(i));
- return indices.length ? indices : [-1];
-};
-