Travis build: 1177 [cron]
This commit is contained in:
7
dist/_30s.es5.js
vendored
7
dist/_30s.es5.js
vendored
@ -665,11 +665,12 @@
|
|||||||
return arr.slice(0, -n);
|
return arr.slice(0, -n);
|
||||||
};
|
};
|
||||||
var dropRightWhile = function dropRightWhile(arr, func) {
|
var dropRightWhile = function dropRightWhile(arr, func) {
|
||||||
while (arr.length > 0 && !func(arr[arr.length - 1])) {
|
var rightIndex = arr.length;
|
||||||
arr = arr.slice(0, -1);
|
|
||||||
|
while (rightIndex-- && !func(arr[rightIndex])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr;
|
return arr.slice(0, rightIndex + 1);
|
||||||
};
|
};
|
||||||
var dropWhile = function dropWhile(arr, func) {
|
var dropWhile = function dropWhile(arr, func) {
|
||||||
while (arr.length > 0 && !func(arr[0])) {
|
while (arr.length > 0 && !func(arr[0])) {
|
||||||
|
|||||||
2
dist/_30s.es5.min.js
vendored
2
dist/_30s.es5.min.js
vendored
File diff suppressed because one or more lines are too long
5
dist/_30s.esm.js
vendored
5
dist/_30s.esm.js
vendored
@ -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 drop = (arr, n = 1) => arr.slice(n);
|
||||||
const dropRight = (arr, n = 1) => arr.slice(0, -n);
|
const dropRight = (arr, n = 1) => arr.slice(0, -n);
|
||||||
const dropRightWhile = (arr, func) => {
|
const dropRightWhile = (arr, func) => {
|
||||||
while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);
|
let rightIndex = arr.length;
|
||||||
return arr;
|
while (rightIndex-- && !func(arr[rightIndex]));
|
||||||
|
return arr.slice(0, rightIndex + 1);
|
||||||
};
|
};
|
||||||
const dropWhile = (arr, func) => {
|
const dropWhile = (arr, func) => {
|
||||||
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
|
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
|
||||||
|
|||||||
5
dist/_30s.js
vendored
5
dist/_30s.js
vendored
@ -282,8 +282,9 @@
|
|||||||
const drop = (arr, n = 1) => arr.slice(n);
|
const drop = (arr, n = 1) => arr.slice(n);
|
||||||
const dropRight = (arr, n = 1) => arr.slice(0, -n);
|
const dropRight = (arr, n = 1) => arr.slice(0, -n);
|
||||||
const dropRightWhile = (arr, func) => {
|
const dropRightWhile = (arr, func) => {
|
||||||
while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);
|
let rightIndex = arr.length;
|
||||||
return arr;
|
while (rightIndex-- && !func(arr[rightIndex]));
|
||||||
|
return arr.slice(0, rightIndex + 1);
|
||||||
};
|
};
|
||||||
const dropWhile = (arr, func) => {
|
const dropWhile = (arr, func) => {
|
||||||
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
|
while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
|
||||||
|
|||||||
@ -386,7 +386,7 @@
|
|||||||
"archived": false
|
"archived": false
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "ab66ab76096083ad5861e228065926db7b8aee7f240d12ad00467a78b35f089c"
|
"hash": "92073a46ed91184fb52d53ecc1ef1265c8eaf3e13f9715796a4c19ebed2e9556"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1043,7 +1043,7 @@
|
|||||||
"archived": false
|
"archived": false
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "2ae245946d7c0d704aa1bbadf43afad388c09ac5dba409439b8ea79c1d4ad944"
|
"hash": "3ce42322e5de148e0000781954289a75f19453def5a75de07e56a0d1cd0987ae"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -568,7 +568,7 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"hash": "ab66ab76096083ad5861e228065926db7b8aee7f240d12ad00467a78b35f089c"
|
"hash": "92073a46ed91184fb52d53ecc1ef1265c8eaf3e13f9715796a4c19ebed2e9556"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1528,8 +1528,8 @@
|
|||||||
"fileName": "dropRightWhile.md",
|
"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.",
|
"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": {
|
"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};",
|
"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 while (arr.length > 0 && !func(arr[arr.length - 1])) {\n arr = arr.slice(0, -1);\n }\n\n return arr;\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]"
|
"example": "dropRightWhile([1, 2, 3, 4], n => n < 3); // [1, 2]"
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
@ -1540,7 +1540,7 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"hash": "2ae245946d7c0d704aa1bbadf43afad388c09ac5dba409439b8ea79c1d4ad944"
|
"hash": "3ce42322e5de148e0000781954289a75f19453def5a75de07e56a0d1cd0987ae"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -668,8 +668,9 @@
|
|||||||
"prefix": "30s_dropRightWhile",
|
"prefix": "30s_dropRightWhile",
|
||||||
"body": [
|
"body": [
|
||||||
"const dropRightWhile = (arr, func) => {",
|
"const dropRightWhile = (arr, func) => {",
|
||||||
" while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);",
|
" let rightIndex = arr.length;",
|
||||||
" return arr;",
|
" 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"
|
"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"
|
||||||
|
|||||||
Reference in New Issue
Block a user