es-toolkit 1.48.1-dev.1881 → 1.48.1-dev.1883

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.
@@ -6,9 +6,8 @@
6
6
  * of elements removed from the start.
7
7
  *
8
8
  * @template T - The type of elements in the array.
9
- * @param collection - The array from which to drop elements.
9
+ * @param array - The array from which to drop elements.
10
10
  * @param itemsCount - The number of elements to drop from the beginning of the array.
11
- * @param [guard] - Enables use as an iteratee for methods like `_.map`.
12
11
  * @returns A new array with the specified number of elements removed from the start.
13
12
  *
14
13
  * @example
@@ -16,6 +15,6 @@
16
15
  * const result = drop(array, 2);
17
16
  * result will be [3, 4, 5] since the first two elements are dropped.
18
17
  */
19
- declare function drop<T>(array: ArrayLike<T> | null | undefined, n?: number): T[];
18
+ declare function drop<T>(array: ArrayLike<T> | null | undefined, itemsCount?: number): T[];
20
19
  //#endregion
21
20
  export { drop };
@@ -6,9 +6,8 @@
6
6
  * of elements removed from the start.
7
7
  *
8
8
  * @template T - The type of elements in the array.
9
- * @param collection - The array from which to drop elements.
9
+ * @param array - The array from which to drop elements.
10
10
  * @param itemsCount - The number of elements to drop from the beginning of the array.
11
- * @param [guard] - Enables use as an iteratee for methods like `_.map`.
12
11
  * @returns A new array with the specified number of elements removed from the start.
13
12
  *
14
13
  * @example
@@ -16,6 +15,6 @@
16
15
  * const result = drop(array, 2);
17
16
  * result will be [3, 4, 5] since the first two elements are dropped.
18
17
  */
19
- declare function drop<T>(array: ArrayLike<T> | null | undefined, n?: number): T[];
18
+ declare function drop<T>(array: ArrayLike<T> | null | undefined, itemsCount?: number): T[];
20
19
  //#endregion
21
20
  export { drop };
@@ -3,10 +3,10 @@ const require_toInteger = require("../util/toInteger.js");
3
3
  const require_toArray = require("../_internal/toArray.js");
4
4
  const require_isArrayLike = require("../predicate/isArrayLike.js");
5
5
  //#region src/compat/array/drop.ts
6
- function drop(collection, itemsCount = 1, guard) {
7
- if (!require_isArrayLike.isArrayLike(collection)) return [];
6
+ function drop(array, itemsCount = 1, guard) {
7
+ if (!require_isArrayLike.isArrayLike(array)) return [];
8
8
  itemsCount = guard ? 1 : require_toInteger.toInteger(itemsCount);
9
- return require_drop.drop(require_toArray.toArray(collection), itemsCount);
9
+ return require_drop.drop(require_toArray.toArray(array), itemsCount);
10
10
  }
11
11
  //#endregion
12
12
  exports.drop = drop;
@@ -3,10 +3,10 @@ import { toInteger } from "../util/toInteger.mjs";
3
3
  import { toArray } from "../_internal/toArray.mjs";
4
4
  import { isArrayLike } from "../predicate/isArrayLike.mjs";
5
5
  //#region src/compat/array/drop.ts
6
- function drop(collection, itemsCount = 1, guard) {
7
- if (!isArrayLike(collection)) return [];
6
+ function drop(array, itemsCount = 1, guard) {
7
+ if (!isArrayLike(array)) return [];
8
8
  itemsCount = guard ? 1 : toInteger(itemsCount);
9
- return drop$1(toArray(collection), itemsCount);
9
+ return drop$1(toArray(array), itemsCount);
10
10
  }
11
11
  //#endregion
12
12
  export { drop };
@@ -13,7 +13,7 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
13
13
  * predicate function returns false. It then returns a new array with the remaining elements.
14
14
  *
15
15
  * @template T - The type of elements in the array.
16
- * @param arr - The array from which to drop elements.
16
+ * @param array - The array from which to drop elements.
17
17
  * @param predicate - A predicate function that determines
18
18
  * whether to continue dropping elements. The function is called with each element, index, and array, and dropping
19
19
  * continues as long as it returns true.
@@ -24,9 +24,9 @@ const require_matchesProperty = require("../predicate/matchesProperty.js");
24
24
  * const result = dropRightWhile(array, (item, index, arr) => index >= 1);
25
25
  * // Returns: [3]
26
26
  */
27
- function dropRightWhile(arr, predicate = require_identity.identity) {
28
- if (!require_isArrayLike.isArrayLike(arr)) return [];
29
- return dropRightWhileImpl(require_toArray.toArray(arr), predicate);
27
+ function dropRightWhile(array, predicate = require_identity.identity) {
28
+ if (!require_isArrayLike.isArrayLike(array)) return [];
29
+ return dropRightWhileImpl(require_toArray.toArray(array), predicate);
30
30
  }
31
31
  function dropRightWhileImpl(arr, predicate) {
32
32
  switch (typeof predicate) {
@@ -13,7 +13,7 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
13
13
  * predicate function returns false. It then returns a new array with the remaining elements.
14
14
  *
15
15
  * @template T - The type of elements in the array.
16
- * @param arr - The array from which to drop elements.
16
+ * @param array - The array from which to drop elements.
17
17
  * @param predicate - A predicate function that determines
18
18
  * whether to continue dropping elements. The function is called with each element, index, and array, and dropping
19
19
  * continues as long as it returns true.
@@ -24,9 +24,9 @@ import { matchesProperty } from "../predicate/matchesProperty.mjs";
24
24
  * const result = dropRightWhile(array, (item, index, arr) => index >= 1);
25
25
  * // Returns: [3]
26
26
  */
27
- function dropRightWhile(arr, predicate = identity) {
28
- if (!isArrayLike(arr)) return [];
29
- return dropRightWhileImpl(toArray(arr), predicate);
27
+ function dropRightWhile(array, predicate = identity) {
28
+ if (!isArrayLike(array)) return [];
29
+ return dropRightWhileImpl(toArray(array), predicate);
30
30
  }
31
31
  function dropRightWhileImpl(arr, predicate) {
32
32
  switch (typeof predicate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.48.1-dev.1881+f998a093",
3
+ "version": "1.48.1-dev.1883+3c6aa98f",
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",