Travis build: 1177 [cron]

This commit is contained in:
30secondsofcode
2019-05-29 15:51:46 +00:00
parent 9063fad13d
commit 0910152a4b
7 changed files with 20 additions and 16 deletions

7
dist/_30s.es5.js vendored
View File

@ -665,11 +665,12 @@
return arr.slice(0, -n);
};
var dropRightWhile = function dropRightWhile(arr, func) {
while (arr.length > 0 && !func(arr[arr.length - 1])) {
arr = arr.slice(0, -1);
var rightIndex = arr.length;
while (rightIndex-- && !func(arr[rightIndex])) {
}
return arr;
return arr.slice(0, rightIndex + 1);
};
var dropWhile = function dropWhile(arr, func) {
while (arr.length > 0 && !func(arr[0])) {

File diff suppressed because one or more lines are too long

5
dist/_30s.esm.js vendored
View File

@ -276,8 +276,9 @@ const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
const drop = (arr, n = 1) => arr.slice(n);
const dropRight = (arr, n = 1) => arr.slice(0, -n);
const dropRightWhile = (arr, func) => {
while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);
return arr;
let rightIndex = arr.length;
while (rightIndex-- && !func(arr[rightIndex]));
return arr.slice(0, rightIndex + 1);
};
const dropWhile = (arr, func) => {
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);

5
dist/_30s.js vendored
View File

@ -282,8 +282,9 @@
const drop = (arr, n = 1) => arr.slice(n);
const dropRight = (arr, n = 1) => arr.slice(0, -n);
const dropRightWhile = (arr, func) => {
while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);
return arr;
let rightIndex = arr.length;
while (rightIndex-- && !func(arr[rightIndex]));
return arr.slice(0, rightIndex + 1);
};
const dropWhile = (arr, func) => {
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);

View File

@ -386,7 +386,7 @@
"archived": false
},
"meta": {
"hash": "ab66ab76096083ad5861e228065926db7b8aee7f240d12ad00467a78b35f089c"
"hash": "92073a46ed91184fb52d53ecc1ef1265c8eaf3e13f9715796a4c19ebed2e9556"
}
},
{
@ -1043,7 +1043,7 @@
"archived": false
},
"meta": {
"hash": "2ae245946d7c0d704aa1bbadf43afad388c09ac5dba409439b8ea79c1d4ad944"
"hash": "3ce42322e5de148e0000781954289a75f19453def5a75de07e56a0d1cd0987ae"
}
},
{

View File

@ -568,7 +568,7 @@
},
"meta": {
"archived": false,
"hash": "ab66ab76096083ad5861e228065926db7b8aee7f240d12ad00467a78b35f089c"
"hash": "92073a46ed91184fb52d53ecc1ef1265c8eaf3e13f9715796a4c19ebed2e9556"
}
},
{
@ -1528,8 +1528,8 @@
"fileName": "dropRightWhile.md",
"text": "Removes elements from the end of an array until the passed function returns `true`. Returns the remaining elements in the array.\n\nLoop through the array, using `Array.prototype.slice()` to drop the last element of the array until the returned value from the function is `true`.\nReturns the remaining elements.",
"codeBlocks": {
"es6": "const dropRightWhile = (arr, func) => {\n while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);\n return arr;\n};",
"es5": "var dropRightWhile = function dropRightWhile(arr, func) {\n while (arr.length > 0 && !func(arr[arr.length - 1])) {\n arr = arr.slice(0, -1);\n }\n\n return arr;\n};",
"es6": "const dropRightWhile = (arr, func) => {\n let rightIndex = arr.length;\n while (rightIndex-- && !func(arr[rightIndex]));\n return arr.slice(0, rightIndex + 1);\n};",
"es5": "var dropRightWhile = function dropRightWhile(arr, func) {\n var rightIndex = arr.length;\n\n while (rightIndex-- && !func(arr[rightIndex])) {\n ;\n }\n\n return arr.slice(0, rightIndex + 1);\n};",
"example": "dropRightWhile([1, 2, 3, 4], n => n < 3); // [1, 2]"
},
"tags": [
@ -1540,7 +1540,7 @@
},
"meta": {
"archived": false,
"hash": "2ae245946d7c0d704aa1bbadf43afad388c09ac5dba409439b8ea79c1d4ad944"
"hash": "3ce42322e5de148e0000781954289a75f19453def5a75de07e56a0d1cd0987ae"
}
},
{

View File

@ -668,8 +668,9 @@
"prefix": "30s_dropRightWhile",
"body": [
"const dropRightWhile = (arr, func) => {",
" while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);",
" return arr;",
" let rightIndex = arr.length;",
" while (rightIndex-- && !func(arr[rightIndex]));",
" return arr.slice(0, rightIndex + 1);",
"};"
],
"description": "Removes elements from the end of an array until the passed function returns `true`. Returns the remaining elements in the array.\n\nLoop through the array, using `Array.prototype.slice()` to drop the last element of the array until the returned value from the function is `true`.\nReturns the remaining elements"