es-toolkit 1.48.1-dev.1879 → 1.48.1-dev.1880
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,7 @@ import { ListIteratee } from "../_internal/ListIteratee.mjs";
|
|
|
7
7
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
8
8
|
*
|
|
9
9
|
* @template T - The type of elements in the array
|
|
10
|
-
* @param
|
|
10
|
+
* @param array - The array to query
|
|
11
11
|
* @param [predicate=identity] - The function invoked per iteration
|
|
12
12
|
* @returns Returns the slice of array
|
|
13
13
|
*
|
|
@@ -24,6 +24,6 @@ import { ListIteratee } from "../_internal/ListIteratee.mjs";
|
|
|
24
24
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
25
25
|
* // => []
|
|
26
26
|
*/
|
|
27
|
-
declare function dropWhile<T>(
|
|
27
|
+
declare function dropWhile<T>(array: ArrayLike<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
|
28
28
|
//#endregion
|
|
29
29
|
export { dropWhile };
|
|
@@ -7,7 +7,7 @@ import { ListIteratee } from "../_internal/ListIteratee.js";
|
|
|
7
7
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
8
8
|
*
|
|
9
9
|
* @template T - The type of elements in the array
|
|
10
|
-
* @param
|
|
10
|
+
* @param array - The array to query
|
|
11
11
|
* @param [predicate=identity] - The function invoked per iteration
|
|
12
12
|
* @returns Returns the slice of array
|
|
13
13
|
*
|
|
@@ -24,6 +24,6 @@ import { ListIteratee } from "../_internal/ListIteratee.js";
|
|
|
24
24
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
25
25
|
* // => []
|
|
26
26
|
*/
|
|
27
|
-
declare function dropWhile<T>(
|
|
27
|
+
declare function dropWhile<T>(array: ArrayLike<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
|
28
28
|
//#endregion
|
|
29
29
|
export { dropWhile };
|
|
@@ -12,7 +12,7 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
12
12
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
13
13
|
*
|
|
14
14
|
* @template T - The type of elements in the array
|
|
15
|
-
* @param
|
|
15
|
+
* @param array - The array to query
|
|
16
16
|
* @param [predicate=identity] - The function invoked per iteration
|
|
17
17
|
* @returns Returns the slice of array
|
|
18
18
|
*
|
|
@@ -29,9 +29,9 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
|
|
|
29
29
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
30
30
|
* // => []
|
|
31
31
|
*/
|
|
32
|
-
function dropWhile(
|
|
33
|
-
if (!require_isArrayLike.isArrayLike(
|
|
34
|
-
return dropWhileImpl(require_toArray.toArray(
|
|
32
|
+
function dropWhile(array, predicate = require_identity.identity) {
|
|
33
|
+
if (!require_isArrayLike.isArrayLike(array)) return [];
|
|
34
|
+
return dropWhileImpl(require_toArray.toArray(array), predicate);
|
|
35
35
|
}
|
|
36
36
|
function dropWhileImpl(arr, predicate) {
|
|
37
37
|
switch (typeof predicate) {
|
|
@@ -12,7 +12,7 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
12
12
|
* The predicate is invoked with three arguments: (value, index, array).
|
|
13
13
|
*
|
|
14
14
|
* @template T - The type of elements in the array
|
|
15
|
-
* @param
|
|
15
|
+
* @param array - The array to query
|
|
16
16
|
* @param [predicate=identity] - The function invoked per iteration
|
|
17
17
|
* @returns Returns the slice of array
|
|
18
18
|
*
|
|
@@ -29,9 +29,9 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
|
29
29
|
* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
|
|
30
30
|
* // => []
|
|
31
31
|
*/
|
|
32
|
-
function dropWhile(
|
|
33
|
-
if (!isArrayLike(
|
|
34
|
-
return dropWhileImpl(toArray(
|
|
32
|
+
function dropWhile(array, predicate = identity) {
|
|
33
|
+
if (!isArrayLike(array)) return [];
|
|
34
|
+
return dropWhileImpl(toArray(array), predicate);
|
|
35
35
|
}
|
|
36
36
|
function dropWhileImpl(arr, predicate) {
|
|
37
37
|
switch (typeof predicate) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.48.1-dev.
|
|
3
|
+
"version": "1.48.1-dev.1880+725e59fa",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|