Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

19
node_modules/es-toolkit/dist/array/at.d.mts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
//#region src/array/at.d.ts
/**
* Retrieves elements from an array at the specified indices.
*
* This function supports negative indices, which count from the end of the array.
*
* @template T
* @param {readonly T[]} arr - The array to retrieve elements from.
* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve.
* @returns {T[]} A new array containing the elements at the specified indices.
*
* @example
* const numbers = [10, 20, 30, 40, 50];
* const result = at(numbers, [1, 3, 4]);
* console.log(result); // [20, 40, 50]
*/
declare function at<T>(arr: readonly T[], indices: number[]): T[];
//#endregion
export { at };

19
node_modules/es-toolkit/dist/array/at.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
//#region src/array/at.d.ts
/**
* Retrieves elements from an array at the specified indices.
*
* This function supports negative indices, which count from the end of the array.
*
* @template T
* @param {readonly T[]} arr - The array to retrieve elements from.
* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve.
* @returns {T[]} A new array containing the elements at the specified indices.
*
* @example
* const numbers = [10, 20, 30, 40, 50];
* const result = at(numbers, [1, 3, 4]);
* console.log(result); // [20, 40, 50]
*/
declare function at<T>(arr: readonly T[], indices: number[]): T[];
//#endregion
export { at };

29
node_modules/es-toolkit/dist/array/at.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
//#region src/array/at.ts
/**
* Retrieves elements from an array at the specified indices.
*
* This function supports negative indices, which count from the end of the array.
*
* @template T
* @param {readonly T[]} arr - The array to retrieve elements from.
* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve.
* @returns {T[]} A new array containing the elements at the specified indices.
*
* @example
* const numbers = [10, 20, 30, 40, 50];
* const result = at(numbers, [1, 3, 4]);
* console.log(result); // [20, 40, 50]
*/
function at(arr, indices) {
const result = new Array(indices.length);
const length = arr.length;
for (let i = 0; i < indices.length; i++) {
let index = indices[i];
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
if (index < 0) index += length;
result[i] = arr[index];
}
return result;
}
//#endregion
exports.at = at;

29
node_modules/es-toolkit/dist/array/at.mjs generated vendored Normal file
View File

@@ -0,0 +1,29 @@
//#region src/array/at.ts
/**
* Retrieves elements from an array at the specified indices.
*
* This function supports negative indices, which count from the end of the array.
*
* @template T
* @param {readonly T[]} arr - The array to retrieve elements from.
* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve.
* @returns {T[]} A new array containing the elements at the specified indices.
*
* @example
* const numbers = [10, 20, 30, 40, 50];
* const result = at(numbers, [1, 3, 4]);
* console.log(result); // [20, 40, 50]
*/
function at(arr, indices) {
const result = new Array(indices.length);
const length = arr.length;
for (let i = 0; i < indices.length; i++) {
let index = indices[i];
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
if (index < 0) index += length;
result[i] = arr[index];
}
return result;
}
//#endregion
export { at };

View File

@@ -0,0 +1,75 @@
//#region src/array/cartesianProduct.d.ts
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T
* @param {readonly T[]} arr1 - The array to take the product of.
* @returns {Array<[T]>} An array of single-element tuples.
*/
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @returns {Array<[T, U]>} An array of tuples representing the Cartesian product.
*
* @example
* cartesianProduct([1, 2], ['a', 'b']);
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
*/
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U, V
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @param {readonly V[]} arr3 - The third array to take the product of.
* @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product.
*/
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U, V, W
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @param {readonly V[]} arr3 - The third array to take the product of.
* @param {readonly W[]} arr4 - The fourth array to take the product of.
* @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product.
*/
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
* The rightmost array advances fastest, like the digits of an odometer.
*
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
* If any input array is empty, the result is `[]`.
*
* @template T
* @param {Array<readonly T[]>} arrs - The arrays to take the product of.
* @returns {T[][]} An array of tuples representing the Cartesian product.
*
* @example
* cartesianProduct([1, 2], ['a', 'b']);
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
*
* @example
* cartesianProduct([0, 1], [0, 1], [0, 1]);
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
*
* @example
* cartesianProduct([1, 2, 3], []);
* // => []
*
* @example
* cartesianProduct();
* // => [[]]
*/
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
//#endregion
export { cartesianProduct };

View File

@@ -0,0 +1,75 @@
//#region src/array/cartesianProduct.d.ts
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T
* @param {readonly T[]} arr1 - The array to take the product of.
* @returns {Array<[T]>} An array of single-element tuples.
*/
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @returns {Array<[T, U]>} An array of tuples representing the Cartesian product.
*
* @example
* cartesianProduct([1, 2], ['a', 'b']);
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
*/
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U, V
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @param {readonly V[]} arr3 - The third array to take the product of.
* @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product.
*/
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* @template T, U, V, W
* @param {readonly T[]} arr1 - The first array to take the product of.
* @param {readonly U[]} arr2 - The second array to take the product of.
* @param {readonly V[]} arr3 - The third array to take the product of.
* @param {readonly W[]} arr4 - The fourth array to take the product of.
* @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product.
*/
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
/**
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
*
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
* The rightmost array advances fastest, like the digits of an odometer.
*
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
* If any input array is empty, the result is `[]`.
*
* @template T
* @param {Array<readonly T[]>} arrs - The arrays to take the product of.
* @returns {T[][]} An array of tuples representing the Cartesian product.
*
* @example
* cartesianProduct([1, 2], ['a', 'b']);
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
*
* @example
* cartesianProduct([0, 1], [0, 1], [0, 1]);
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
*
* @example
* cartesianProduct([1, 2, 3], []);
* // => []
*
* @example
* cartesianProduct();
* // => [[]]
*/
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
//#endregion
export { cartesianProduct };

23
node_modules/es-toolkit/dist/array/cartesianProduct.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
//#region src/array/cartesianProduct.ts
function cartesianProduct(...arrs) {
if (arrs.length === 0) return [[]];
let total = 1;
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
if (total === 0) return [];
const n = arrs.length;
const result = Array(total);
for (let i = 0; i < total; i++) {
const tuple = Array(n);
let idx = i;
for (let j = n - 1; j >= 0; j--) {
const arr = arrs[j];
const len = arr.length;
tuple[j] = arr[idx % len];
idx = Math.floor(idx / len);
}
result[i] = tuple;
}
return result;
}
//#endregion
exports.cartesianProduct = cartesianProduct;

View File

@@ -0,0 +1,23 @@
//#region src/array/cartesianProduct.ts
function cartesianProduct(...arrs) {
if (arrs.length === 0) return [[]];
let total = 1;
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
if (total === 0) return [];
const n = arrs.length;
const result = Array(total);
for (let i = 0; i < total; i++) {
const tuple = Array(n);
let idx = i;
for (let j = n - 1; j >= 0; j--) {
const arr = arrs[j];
const len = arr.length;
tuple[j] = arr[idx % len];
idx = Math.floor(idx / len);
}
result[i] = tuple;
}
return result;
}
//#endregion
export { cartesianProduct };

27
node_modules/es-toolkit/dist/array/chunk.d.mts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
//#region src/array/chunk.d.ts
/**
* Splits an array into smaller arrays of a specified length.
*
* This function takes an input array and divides it into multiple smaller arrays,
* each of a specified length. If the input array cannot be evenly divided,
* the final sub-array will contain the remaining elements.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The array to be chunked into smaller arrays.
* @param {number} size - The size of each smaller array. Must be a positive integer.
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
* @throws {Error} Throws an error if `size` is not a positive integer.
*
* @example
* // Splits an array of numbers into sub-arrays of length 2
* chunk([1, 2, 3, 4, 5], 2);
* // Returns: [[1, 2], [3, 4], [5]]
*
* @example
* // Splits an array of strings into sub-arrays of length 3
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
*/
declare function chunk<T>(arr: readonly T[], size: number): T[][];
//#endregion
export { chunk };

27
node_modules/es-toolkit/dist/array/chunk.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
//#region src/array/chunk.d.ts
/**
* Splits an array into smaller arrays of a specified length.
*
* This function takes an input array and divides it into multiple smaller arrays,
* each of a specified length. If the input array cannot be evenly divided,
* the final sub-array will contain the remaining elements.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The array to be chunked into smaller arrays.
* @param {number} size - The size of each smaller array. Must be a positive integer.
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
* @throws {Error} Throws an error if `size` is not a positive integer.
*
* @example
* // Splits an array of numbers into sub-arrays of length 2
* chunk([1, 2, 3, 4, 5], 2);
* // Returns: [[1, 2], [3, 4], [5]]
*
* @example
* // Splits an array of strings into sub-arrays of length 3
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
*/
declare function chunk<T>(arr: readonly T[], size: number): T[][];
//#endregion
export { chunk };

37
node_modules/es-toolkit/dist/array/chunk.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
//#region src/array/chunk.ts
/**
* Splits an array into smaller arrays of a specified length.
*
* This function takes an input array and divides it into multiple smaller arrays,
* each of a specified length. If the input array cannot be evenly divided,
* the final sub-array will contain the remaining elements.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The array to be chunked into smaller arrays.
* @param {number} size - The size of each smaller array. Must be a positive integer.
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
* @throws {Error} Throws an error if `size` is not a positive integer.
*
* @example
* // Splits an array of numbers into sub-arrays of length 2
* chunk([1, 2, 3, 4, 5], 2);
* // Returns: [[1, 2], [3, 4], [5]]
*
* @example
* // Splits an array of strings into sub-arrays of length 3
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
*/
function chunk(arr, size) {
if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
const chunkLength = Math.ceil(arr.length / size);
const result = Array(chunkLength);
for (let index = 0; index < chunkLength; index++) {
const start = index * size;
const end = start + size;
result[index] = arr.slice(start, end);
}
return result;
}
//#endregion
exports.chunk = chunk;

37
node_modules/es-toolkit/dist/array/chunk.mjs generated vendored Normal file
View File

@@ -0,0 +1,37 @@
//#region src/array/chunk.ts
/**
* Splits an array into smaller arrays of a specified length.
*
* This function takes an input array and divides it into multiple smaller arrays,
* each of a specified length. If the input array cannot be evenly divided,
* the final sub-array will contain the remaining elements.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The array to be chunked into smaller arrays.
* @param {number} size - The size of each smaller array. Must be a positive integer.
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
* @throws {Error} Throws an error if `size` is not a positive integer.
*
* @example
* // Splits an array of numbers into sub-arrays of length 2
* chunk([1, 2, 3, 4, 5], 2);
* // Returns: [[1, 2], [3, 4], [5]]
*
* @example
* // Splits an array of strings into sub-arrays of length 3
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
*/
function chunk(arr, size) {
if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
const chunkLength = Math.ceil(arr.length / size);
const result = Array(chunkLength);
for (let index = 0; index < chunkLength; index++) {
const start = index * size;
const end = start + size;
result[index] = arr.slice(start, end);
}
return result;
}
//#endregion
export { chunk };

35
node_modules/es-toolkit/dist/array/combinations.d.mts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
//#region src/array/combinations.d.ts
/**
* Returns all `r`-length combinations of elements from the input array.
*
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
* combinations that look identical.
*
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
*
* @template T
* @param {readonly T[]} arr - The input array.
* @param {number} r - The length of each combination. Must be a non-negative integer.
* @returns {T[][]} An array of `r`-length combinations.
* @throws {Error} If `r` is not a non-negative integer.
*
* @example
* combinations(['A', 'B', 'C', 'D'], 2);
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
*
* @example
* combinations([1, 2, 3, 4], 3);
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
*
* @example
* combinations([1, 2, 3], 0);
* // => [[]]
*
* @example
* combinations([1, 2], 5);
* // => []
*/
declare function combinations<T>(arr: readonly T[], r: number): T[][];
//#endregion
export { combinations };

35
node_modules/es-toolkit/dist/array/combinations.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
//#region src/array/combinations.d.ts
/**
* Returns all `r`-length combinations of elements from the input array.
*
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
* combinations that look identical.
*
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
*
* @template T
* @param {readonly T[]} arr - The input array.
* @param {number} r - The length of each combination. Must be a non-negative integer.
* @returns {T[][]} An array of `r`-length combinations.
* @throws {Error} If `r` is not a non-negative integer.
*
* @example
* combinations(['A', 'B', 'C', 'D'], 2);
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
*
* @example
* combinations([1, 2, 3, 4], 3);
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
*
* @example
* combinations([1, 2, 3], 0);
* // => [[]]
*
* @example
* combinations([1, 2], 5);
* // => []
*/
declare function combinations<T>(arr: readonly T[], r: number): T[][];
//#endregion
export { combinations };

53
node_modules/es-toolkit/dist/array/combinations.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
//#region src/array/combinations.ts
/**
* Returns all `r`-length combinations of elements from the input array.
*
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
* combinations that look identical.
*
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
*
* @template T
* @param {readonly T[]} arr - The input array.
* @param {number} r - The length of each combination. Must be a non-negative integer.
* @returns {T[][]} An array of `r`-length combinations.
* @throws {Error} If `r` is not a non-negative integer.
*
* @example
* combinations(['A', 'B', 'C', 'D'], 2);
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
*
* @example
* combinations([1, 2, 3, 4], 3);
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
*
* @example
* combinations([1, 2, 3], 0);
* // => [[]]
*
* @example
* combinations([1, 2], 5);
* // => []
*/
function combinations(arr, r) {
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
const n = arr.length;
if (r > n) return [];
if (r === 0) return [[]];
const indices = Array(r);
for (let i = 0; i < r; i++) indices[i] = i;
const result = [];
while (true) {
const tuple = Array(r);
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
result.push(tuple);
let i = r - 1;
while (i >= 0 && indices[i] === i + n - r) i--;
if (i < 0) return result;
indices[i]++;
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
}
}
//#endregion
exports.combinations = combinations;

53
node_modules/es-toolkit/dist/array/combinations.mjs generated vendored Normal file
View File

@@ -0,0 +1,53 @@
//#region src/array/combinations.ts
/**
* Returns all `r`-length combinations of elements from the input array.
*
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
* combinations that look identical.
*
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
*
* @template T
* @param {readonly T[]} arr - The input array.
* @param {number} r - The length of each combination. Must be a non-negative integer.
* @returns {T[][]} An array of `r`-length combinations.
* @throws {Error} If `r` is not a non-negative integer.
*
* @example
* combinations(['A', 'B', 'C', 'D'], 2);
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
*
* @example
* combinations([1, 2, 3, 4], 3);
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
*
* @example
* combinations([1, 2, 3], 0);
* // => [[]]
*
* @example
* combinations([1, 2], 5);
* // => []
*/
function combinations(arr, r) {
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
const n = arr.length;
if (r > n) return [];
if (r === 0) return [[]];
const indices = Array(r);
for (let i = 0; i < r; i++) indices[i] = i;
const result = [];
while (true) {
const tuple = Array(r);
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
result.push(tuple);
let i = r - 1;
while (i >= 0 && indices[i] === i + n - r) i--;
if (i < 0) return result;
indices[i]++;
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
}
}
//#endregion
export { combinations };

16
node_modules/es-toolkit/dist/array/compact.d.mts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
//#region src/array/compact.d.ts
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
/**
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The input array to remove falsey values.
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
*
* @example
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
* Returns: [1, 2, 3, 4, 5]
*/
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
//#endregion
export { compact };

16
node_modules/es-toolkit/dist/array/compact.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
//#region src/array/compact.d.ts
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
/**
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The input array to remove falsey values.
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
*
* @example
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
* Returns: [1, 2, 3, 4, 5]
*/
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
//#endregion
export { compact };

22
node_modules/es-toolkit/dist/array/compact.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
//#region src/array/compact.ts
/**
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The input array to remove falsey values.
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
*
* @example
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
* Returns: [1, 2, 3, 4, 5]
*/
function compact(arr) {
const result = [];
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (item) result.push(item);
}
return result;
}
//#endregion
exports.compact = compact;

22
node_modules/es-toolkit/dist/array/compact.mjs generated vendored Normal file
View File

@@ -0,0 +1,22 @@
//#region src/array/compact.ts
/**
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The input array to remove falsey values.
* @returns {Array<Exclude<T, false | null | 0 | 0n | '' | undefined>>} - A new array with all falsey values removed.
*
* @example
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
* Returns: [1, 2, 3, 4, 5]
*/
function compact(arr) {
const result = [];
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (item) result.push(item);
}
return result;
}
//#endregion
export { compact };

37
node_modules/es-toolkit/dist/array/countBy.d.mts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
//#region src/array/countBy.d.ts
/**
* Count the occurrences of each item in an array
* based on a transformation function.
*
* This function takes an array and a transformation function
* that converts each item in the array to a key. It then
* counts the occurrences of each transformed item and returns
* an object with the transformed items as keys and the counts
* as values.
*
* @template T - The type of the items in the input array.
* @template K - The type of keys.
* @param {T[]} arr - The input array to count occurrences.
* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key.
* @returns {Record<K, number>} An object containing the transformed items as keys and the
* counts as values.
*
* @example
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
* const result = countBy(array, x => x);
* // result will be { a: 3, b: 2, c: 1 }
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
* // result will be { odd: 3, even: 2 }
*
* @example
* // Using index parameter
* const array = ['a', 'b', 'c', 'd'];
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
* // result will be { first: 2, rest: 2 }
*/
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record<K, number>;
//#endregion
export { countBy };

37
node_modules/es-toolkit/dist/array/countBy.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
//#region src/array/countBy.d.ts
/**
* Count the occurrences of each item in an array
* based on a transformation function.
*
* This function takes an array and a transformation function
* that converts each item in the array to a key. It then
* counts the occurrences of each transformed item and returns
* an object with the transformed items as keys and the counts
* as values.
*
* @template T - The type of the items in the input array.
* @template K - The type of keys.
* @param {T[]} arr - The input array to count occurrences.
* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key.
* @returns {Record<K, number>} An object containing the transformed items as keys and the
* counts as values.
*
* @example
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
* const result = countBy(array, x => x);
* // result will be { a: 3, b: 2, c: 1 }
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
* // result will be { odd: 3, even: 2 }
*
* @example
* // Using index parameter
* const array = ['a', 'b', 'c', 'd'];
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
* // result will be { first: 2, rest: 2 }
*/
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record<K, number>;
//#endregion
export { countBy };

45
node_modules/es-toolkit/dist/array/countBy.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
//#region src/array/countBy.ts
/**
* Count the occurrences of each item in an array
* based on a transformation function.
*
* This function takes an array and a transformation function
* that converts each item in the array to a key. It then
* counts the occurrences of each transformed item and returns
* an object with the transformed items as keys and the counts
* as values.
*
* @template T - The type of the items in the input array.
* @template K - The type of keys.
* @param {T[]} arr - The input array to count occurrences.
* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key.
* @returns {Record<K, number>} An object containing the transformed items as keys and the
* counts as values.
*
* @example
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
* const result = countBy(array, x => x);
* // result will be { a: 3, b: 2, c: 1 }
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
* // result will be { odd: 3, even: 2 }
*
* @example
* // Using index parameter
* const array = ['a', 'b', 'c', 'd'];
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
* // result will be { first: 2, rest: 2 }
*/
function countBy(arr, mapper) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = mapper(item, i, arr);
result[key] = (result[key] ?? 0) + 1;
}
return result;
}
//#endregion
exports.countBy = countBy;

45
node_modules/es-toolkit/dist/array/countBy.mjs generated vendored Normal file
View File

@@ -0,0 +1,45 @@
//#region src/array/countBy.ts
/**
* Count the occurrences of each item in an array
* based on a transformation function.
*
* This function takes an array and a transformation function
* that converts each item in the array to a key. It then
* counts the occurrences of each transformed item and returns
* an object with the transformed items as keys and the counts
* as values.
*
* @template T - The type of the items in the input array.
* @template K - The type of keys.
* @param {T[]} arr - The input array to count occurrences.
* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key.
* @returns {Record<K, number>} An object containing the transformed items as keys and the
* counts as values.
*
* @example
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
* const result = countBy(array, x => x);
* // result will be { a: 3, b: 2, c: 1 }
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
* // result will be { odd: 3, even: 2 }
*
* @example
* // Using index parameter
* const array = ['a', 'b', 'c', 'd'];
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
* // result will be { first: 2, rest: 2 }
*/
function countBy(arr, mapper) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = mapper(item, i, arr);
result[key] = (result[key] ?? 0) + 1;
}
return result;
}
//#endregion
export { countBy };

26
node_modules/es-toolkit/dist/array/difference.d.mts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/difference.d.ts
/**
* Computes the difference between two arrays.
*
* This function takes two arrays and returns a new array containing the elements
* that are present in the first array but not in the second array. It effectively
* filters out any elements from the first array that also appear in the second array.
*
* @template T
* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array
* from which elements will be compared and filtered.
* @param {T[]} secondArr - The array containing elements to be excluded from the first array.
* Each element in this array will be checked against the first array, and if a match is found,
* that element will be excluded from the result.
* @returns {T[]} A new array containing the elements that are present in the first array but not
* in the second array.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [2, 4];
* const result = difference(array1, array2);
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
*/
declare function difference<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
//#endregion
export { difference };

26
node_modules/es-toolkit/dist/array/difference.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/difference.d.ts
/**
* Computes the difference between two arrays.
*
* This function takes two arrays and returns a new array containing the elements
* that are present in the first array but not in the second array. It effectively
* filters out any elements from the first array that also appear in the second array.
*
* @template T
* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array
* from which elements will be compared and filtered.
* @param {T[]} secondArr - The array containing elements to be excluded from the first array.
* Each element in this array will be checked against the first array, and if a match is found,
* that element will be excluded from the result.
* @returns {T[]} A new array containing the elements that are present in the first array but not
* in the second array.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [2, 4];
* const result = difference(array1, array2);
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
*/
declare function difference<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
//#endregion
export { difference };

29
node_modules/es-toolkit/dist/array/difference.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
//#region src/array/difference.ts
/**
* Computes the difference between two arrays.
*
* This function takes two arrays and returns a new array containing the elements
* that are present in the first array but not in the second array. It effectively
* filters out any elements from the first array that also appear in the second array.
*
* @template T
* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array
* from which elements will be compared and filtered.
* @param {T[]} secondArr - The array containing elements to be excluded from the first array.
* Each element in this array will be checked against the first array, and if a match is found,
* that element will be excluded from the result.
* @returns {T[]} A new array containing the elements that are present in the first array but not
* in the second array.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [2, 4];
* const result = difference(array1, array2);
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
*/
function difference(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter((item) => !secondSet.has(item));
}
//#endregion
exports.difference = difference;

29
node_modules/es-toolkit/dist/array/difference.mjs generated vendored Normal file
View File

@@ -0,0 +1,29 @@
//#region src/array/difference.ts
/**
* Computes the difference between two arrays.
*
* This function takes two arrays and returns a new array containing the elements
* that are present in the first array but not in the second array. It effectively
* filters out any elements from the first array that also appear in the second array.
*
* @template T
* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array
* from which elements will be compared and filtered.
* @param {T[]} secondArr - The array containing elements to be excluded from the first array.
* Each element in this array will be checked against the first array, and if a match is found,
* that element will be excluded from the result.
* @returns {T[]} A new array containing the elements that are present in the first array but not
* in the second array.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [2, 4];
* const result = difference(array1, array2);
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
*/
function difference(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter((item) => !secondSet.has(item));
}
//#endregion
export { difference };

36
node_modules/es-toolkit/dist/array/differenceBy.d.mts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/differenceBy.d.ts
/**
* Computes the difference between two arrays after mapping their elements through a provided function.
*
* This function takes two arrays and a mapper function. It returns a new array containing the elements
* that are present in the first array but not in the second array, based on the identity calculated
* by the mapper function.
*
* Essentially, it filters out any elements from the first array that, when
* mapped, match an element in the mapped version of the second array.
*
* @template T, U
* @param {T[]} firstArr - The primary array from which to derive the difference.
* @param {U[]} secondArr - The array containing elements to be excluded from the first array.
* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding
* mapped identity in the second array.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const mapper = item => item.id;
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const mapper = item => (typeof item === 'object' ? item.id : item);
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
*/
declare function differenceBy<T, U>(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[];
//#endregion
export { differenceBy };

36
node_modules/es-toolkit/dist/array/differenceBy.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/differenceBy.d.ts
/**
* Computes the difference between two arrays after mapping their elements through a provided function.
*
* This function takes two arrays and a mapper function. It returns a new array containing the elements
* that are present in the first array but not in the second array, based on the identity calculated
* by the mapper function.
*
* Essentially, it filters out any elements from the first array that, when
* mapped, match an element in the mapped version of the second array.
*
* @template T, U
* @param {T[]} firstArr - The primary array from which to derive the difference.
* @param {U[]} secondArr - The array containing elements to be excluded from the first array.
* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding
* mapped identity in the second array.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const mapper = item => item.id;
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const mapper = item => (typeof item === 'object' ? item.id : item);
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
*/
declare function differenceBy<T, U>(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[];
//#endregion
export { differenceBy };

41
node_modules/es-toolkit/dist/array/differenceBy.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
//#region src/array/differenceBy.ts
/**
* Computes the difference between two arrays after mapping their elements through a provided function.
*
* This function takes two arrays and a mapper function. It returns a new array containing the elements
* that are present in the first array but not in the second array, based on the identity calculated
* by the mapper function.
*
* Essentially, it filters out any elements from the first array that, when
* mapped, match an element in the mapped version of the second array.
*
* @template T, U
* @param {T[]} firstArr - The primary array from which to derive the difference.
* @param {U[]} secondArr - The array containing elements to be excluded from the first array.
* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding
* mapped identity in the second array.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const mapper = item => item.id;
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const mapper = item => (typeof item === 'object' ? item.id : item);
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
*/
function differenceBy(firstArr, secondArr, mapper) {
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
return firstArr.filter((item) => {
return !mappedSecondSet.has(mapper(item));
});
}
//#endregion
exports.differenceBy = differenceBy;

41
node_modules/es-toolkit/dist/array/differenceBy.mjs generated vendored Normal file
View File

@@ -0,0 +1,41 @@
//#region src/array/differenceBy.ts
/**
* Computes the difference between two arrays after mapping their elements through a provided function.
*
* This function takes two arrays and a mapper function. It returns a new array containing the elements
* that are present in the first array but not in the second array, based on the identity calculated
* by the mapper function.
*
* Essentially, it filters out any elements from the first array that, when
* mapped, match an element in the mapped version of the second array.
*
* @template T, U
* @param {T[]} firstArr - The primary array from which to derive the difference.
* @param {U[]} secondArr - The array containing elements to be excluded from the first array.
* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding
* mapped identity in the second array.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const mapper = item => item.id;
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const mapper = item => (typeof item === 'object' ? item.id : item);
* const result = differenceBy(array1, array2, mapper);
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
*/
function differenceBy(firstArr, secondArr, mapper) {
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
return firstArr.filter((item) => {
return !mappedSecondSet.has(mapper(item));
});
}
//#endregion
export { differenceBy };

View File

@@ -0,0 +1,32 @@
//#region src/array/differenceWith.d.ts
/**
* Computes the difference between two arrays based on a custom equality function.
*
* This function takes two arrays and a custom comparison function. It returns a new array containing
* the elements that are present in the first array but not in the second array. The comparison to determine
* if elements are equal is made using the provided custom function.
*
* @template T, U
* @param {T[]} firstArr - The array from which to get the difference.
* @param {U[]} secondArr - The array containing elements to exclude from the first array.
* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal.
* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array
* according to the custom equality function.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const areItemsEqual = (a, b) => a.id === b.id;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const areItemsEqual = (a, b) => a.id === b;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result.
*/
declare function differenceWith<T, U>(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[];
//#endregion
export { differenceWith };

32
node_modules/es-toolkit/dist/array/differenceWith.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
//#region src/array/differenceWith.d.ts
/**
* Computes the difference between two arrays based on a custom equality function.
*
* This function takes two arrays and a custom comparison function. It returns a new array containing
* the elements that are present in the first array but not in the second array. The comparison to determine
* if elements are equal is made using the provided custom function.
*
* @template T, U
* @param {T[]} firstArr - The array from which to get the difference.
* @param {U[]} secondArr - The array containing elements to exclude from the first array.
* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal.
* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array
* according to the custom equality function.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const areItemsEqual = (a, b) => a.id === b.id;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const areItemsEqual = (a, b) => a.id === b;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result.
*/
declare function differenceWith<T, U>(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[];
//#endregion
export { differenceWith };

38
node_modules/es-toolkit/dist/array/differenceWith.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/differenceWith.ts
/**
* Computes the difference between two arrays based on a custom equality function.
*
* This function takes two arrays and a custom comparison function. It returns a new array containing
* the elements that are present in the first array but not in the second array. The comparison to determine
* if elements are equal is made using the provided custom function.
*
* @template T, U
* @param {T[]} firstArr - The array from which to get the difference.
* @param {U[]} secondArr - The array containing elements to exclude from the first array.
* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal.
* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array
* according to the custom equality function.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const areItemsEqual = (a, b) => a.id === b.id;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const areItemsEqual = (a, b) => a.id === b;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result.
*/
function differenceWith(firstArr, secondArr, areItemsEqual) {
return firstArr.filter((firstItem) => {
return secondArr.every((secondItem) => {
return !areItemsEqual(firstItem, secondItem);
});
});
}
//#endregion
exports.differenceWith = differenceWith;

38
node_modules/es-toolkit/dist/array/differenceWith.mjs generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/differenceWith.ts
/**
* Computes the difference between two arrays based on a custom equality function.
*
* This function takes two arrays and a custom comparison function. It returns a new array containing
* the elements that are present in the first array but not in the second array. The comparison to determine
* if elements are equal is made using the provided custom function.
*
* @template T, U
* @param {T[]} firstArr - The array from which to get the difference.
* @param {U[]} secondArr - The array containing elements to exclude from the first array.
* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal.
* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array
* according to the custom equality function.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [{ id: 2 }, { id: 4 }];
* const areItemsEqual = (a, b) => a.id === b.id;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
*
* @example
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
* const array2 = [2, 4];
* const areItemsEqual = (a, b) => a.id === b;
* const result = differenceWith(array1, array2, areItemsEqual);
* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result.
*/
function differenceWith(firstArr, secondArr, areItemsEqual) {
return firstArr.filter((firstItem) => {
return secondArr.every((secondItem) => {
return !areItemsEqual(firstItem, secondItem);
});
});
}
//#endregion
export { differenceWith };

20
node_modules/es-toolkit/dist/array/drop.d.mts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/drop.d.ts
/**
* Removes a specified number of elements from the beginning of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the start.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the beginning of the array.
* @returns {T[]} A new array with the specified number of elements removed from the start.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = drop(array, 2);
* // result will be [3, 4, 5] since the first two elements are dropped.
*/
declare function drop<T>(arr: readonly T[], itemsCount: number): T[];
//#endregion
export { drop };

20
node_modules/es-toolkit/dist/array/drop.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/drop.d.ts
/**
* Removes a specified number of elements from the beginning of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the start.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the beginning of the array.
* @returns {T[]} A new array with the specified number of elements removed from the start.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = drop(array, 2);
* // result will be [3, 4, 5] since the first two elements are dropped.
*/
declare function drop<T>(arr: readonly T[], itemsCount: number): T[];
//#endregion
export { drop };

23
node_modules/es-toolkit/dist/array/drop.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
//#region src/array/drop.ts
/**
* Removes a specified number of elements from the beginning of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the start.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the beginning of the array.
* @returns {T[]} A new array with the specified number of elements removed from the start.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = drop(array, 2);
* // result will be [3, 4, 5] since the first two elements are dropped.
*/
function drop(arr, itemsCount) {
itemsCount = Math.max(itemsCount, 0);
return arr.slice(itemsCount);
}
//#endregion
exports.drop = drop;

23
node_modules/es-toolkit/dist/array/drop.mjs generated vendored Normal file
View File

@@ -0,0 +1,23 @@
//#region src/array/drop.ts
/**
* Removes a specified number of elements from the beginning of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the start.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the beginning of the array.
* @returns {T[]} A new array with the specified number of elements removed from the start.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = drop(array, 2);
* // result will be [3, 4, 5] since the first two elements are dropped.
*/
function drop(arr, itemsCount) {
itemsCount = Math.max(itemsCount, 0);
return arr.slice(itemsCount);
}
//#endregion
export { drop };

20
node_modules/es-toolkit/dist/array/dropRight.d.mts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/dropRight.d.ts
/**
* Removes a specified number of elements from the end of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the end.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the end of the array.
* @returns {T[]} A new array with the specified number of elements removed from the end.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRight(array, 2);
* // result will be [1, 2, 3] since the last two elements are dropped.
*/
declare function dropRight<T>(arr: readonly T[], itemsCount: number): T[];
//#endregion
export { dropRight };

20
node_modules/es-toolkit/dist/array/dropRight.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/dropRight.d.ts
/**
* Removes a specified number of elements from the end of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the end.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the end of the array.
* @returns {T[]} A new array with the specified number of elements removed from the end.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRight(array, 2);
* // result will be [1, 2, 3] since the last two elements are dropped.
*/
declare function dropRight<T>(arr: readonly T[], itemsCount: number): T[];
//#endregion
export { dropRight };

24
node_modules/es-toolkit/dist/array/dropRight.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
//#region src/array/dropRight.ts
/**
* Removes a specified number of elements from the end of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the end.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the end of the array.
* @returns {T[]} A new array with the specified number of elements removed from the end.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRight(array, 2);
* // result will be [1, 2, 3] since the last two elements are dropped.
*/
function dropRight(arr, itemsCount) {
itemsCount = Math.min(-itemsCount, 0);
if (itemsCount === 0) return arr.slice();
return arr.slice(0, itemsCount);
}
//#endregion
exports.dropRight = dropRight;

24
node_modules/es-toolkit/dist/array/dropRight.mjs generated vendored Normal file
View File

@@ -0,0 +1,24 @@
//#region src/array/dropRight.ts
/**
* Removes a specified number of elements from the end of an array and returns the rest.
*
* This function takes an array and a number, and returns a new array with the specified number
* of elements removed from the end.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {number} itemsCount - The number of elements to drop from the end of the array.
* @returns {T[]} A new array with the specified number of elements removed from the end.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRight(array, 2);
* // result will be [1, 2, 3] since the last two elements are dropped.
*/
function dropRight(arr, itemsCount) {
itemsCount = Math.min(-itemsCount, 0);
if (itemsCount === 0) return arr.slice();
return arr.slice(0, itemsCount);
}
//#endregion
export { dropRight };

View File

@@ -0,0 +1,22 @@
//#region src/array/dropRightWhile.d.ts
/**
* Removes elements from the end of an array until the predicate returns false.
*
* This function iterates over an array from the end and drops elements until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element from the end,
* and dropping continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRightWhile(array, x => x > 3);
* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end.
*/
declare function dropRightWhile<T>(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[];
//#endregion
export { dropRightWhile };

22
node_modules/es-toolkit/dist/array/dropRightWhile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
//#region src/array/dropRightWhile.d.ts
/**
* Removes elements from the end of an array until the predicate returns false.
*
* This function iterates over an array from the end and drops elements until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element from the end,
* and dropping continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRightWhile(array, x => x > 3);
* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end.
*/
declare function dropRightWhile<T>(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[];
//#endregion
export { dropRightWhile };

25
node_modules/es-toolkit/dist/array/dropRightWhile.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
//#region src/array/dropRightWhile.ts
/**
* Removes elements from the end of an array until the predicate returns false.
*
* This function iterates over an array from the end and drops elements until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element from the end,
* and dropping continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRightWhile(array, x => x > 3);
* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end.
*/
function dropRightWhile(arr, canContinueDropping) {
for (let i = arr.length - 1; i >= 0; i--) if (!canContinueDropping(arr[i], i, arr)) return arr.slice(0, i + 1);
return [];
}
//#endregion
exports.dropRightWhile = dropRightWhile;

25
node_modules/es-toolkit/dist/array/dropRightWhile.mjs generated vendored Normal file
View File

@@ -0,0 +1,25 @@
//#region src/array/dropRightWhile.ts
/**
* Removes elements from the end of an array until the predicate returns false.
*
* This function iterates over an array from the end and drops elements until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element from the end,
* and dropping continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropRightWhile(array, x => x > 3);
* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end.
*/
function dropRightWhile(arr, canContinueDropping) {
for (let i = arr.length - 1; i >= 0; i--) if (!canContinueDropping(arr[i], i, arr)) return arr.slice(0, i + 1);
return [];
}
//#endregion
export { dropRightWhile };

22
node_modules/es-toolkit/dist/array/dropWhile.d.mts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
//#region src/array/dropWhile.d.ts
/**
* Removes elements from the beginning of an array until the predicate returns false.
*
* This function iterates over an array and drops elements from the start until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element, and dropping
* continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropWhile(array, x => x < 3);
* // result will be [3, 4, 5] since elements less than 3 are dropped.
*/
declare function dropWhile<T>(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[];
//#endregion
export { dropWhile };

22
node_modules/es-toolkit/dist/array/dropWhile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
//#region src/array/dropWhile.d.ts
/**
* Removes elements from the beginning of an array until the predicate returns false.
*
* This function iterates over an array and drops elements from the start until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element, and dropping
* continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropWhile(array, x => x < 3);
* // result will be [3, 4, 5] since elements less than 3 are dropped.
*/
declare function dropWhile<T>(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[];
//#endregion
export { dropWhile };

26
node_modules/es-toolkit/dist/array/dropWhile.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/dropWhile.ts
/**
* Removes elements from the beginning of an array until the predicate returns false.
*
* This function iterates over an array and drops elements from the start until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element, and dropping
* continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropWhile(array, x => x < 3);
* // result will be [3, 4, 5] since elements less than 3 are dropped.
*/
function dropWhile(arr, canContinueDropping) {
const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr));
if (dropEndIndex === -1) return [];
return arr.slice(dropEndIndex);
}
//#endregion
exports.dropWhile = dropWhile;

26
node_modules/es-toolkit/dist/array/dropWhile.mjs generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/dropWhile.ts
/**
* Removes elements from the beginning of an array until the predicate returns false.
*
* This function iterates over an array and drops elements from the start until the provided
* predicate function returns false. It then returns a new array with the remaining elements.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to drop elements.
* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines
* whether to continue dropping elements. The function is called with each element, and dropping
* continues as long as it returns true.
* @returns {T[]} A new array with the elements remaining after the predicate returns false.
*
* @example
* const array = [1, 2, 3, 4, 5];
* const result = dropWhile(array, x => x < 3);
* // result will be [3, 4, 5] since elements less than 3 are dropped.
*/
function dropWhile(arr, canContinueDropping) {
const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr));
if (dropEndIndex === -1) return [];
return arr.slice(dropEndIndex);
}
//#endregion
export { dropWhile };

86
node_modules/es-toolkit/dist/array/fill.d.mts generated vendored Normal file
View File

@@ -0,0 +1,86 @@
//#region src/array/fill.d.ts
/**
* Fills the whole array with a specified value.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of the value to fill the array with.
* @param {unknown[]} array - The array to fill.
* @param {T} value - The value to fill the array with.
* @returns {T[]} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T>(array: unknown[], value: T): T[];
/**
* Fills elements of an array with a specified value from the start position up to the end of the array.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
/**
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @param {number} [end=arr.length] - The end position. Defaults to the array's length.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
//#endregion
export { fill };

86
node_modules/es-toolkit/dist/array/fill.d.ts generated vendored Normal file
View File

@@ -0,0 +1,86 @@
//#region src/array/fill.d.ts
/**
* Fills the whole array with a specified value.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of the value to fill the array with.
* @param {unknown[]} array - The array to fill.
* @param {T} value - The value to fill the array with.
* @returns {T[]} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T>(array: unknown[], value: T): T[];
/**
* Fills elements of an array with a specified value from the start position up to the end of the array.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
/**
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @param {number} [end=arr.length] - The end position. Defaults to the array's length.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
//#endregion
export { fill };

38
node_modules/es-toolkit/dist/array/fill.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/fill.ts
/**
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @param {number} [end=arr.length] - The end position. Defaults to the array's length.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
function fill(array, value, start = 0, end = array.length) {
const length = array.length;
const finalStart = Math.max(start >= 0 ? start : length + start, 0);
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
for (let i = finalStart; i < finalEnd; i++) array[i] = value;
return array;
}
//#endregion
exports.fill = fill;

38
node_modules/es-toolkit/dist/array/fill.mjs generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/fill.ts
/**
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
*
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
* entire array.
*
* @template T - The type of elements in the original array.
* @template U - The type of the value to fill the array with.
* @param {Array<T | U>} array - The array to fill.
* @param {U} value - The value to fill the array with.
* @param {number} [start=0] - The start position. Defaults to 0.
* @param {number} [end=arr.length] - The end position. Defaults to the array's length.
* @returns {Array<T | U>} The array with the filled values.
*
* @example
* fill([1, 2, 3], 'a');
* // => ['a', 'a', 'a']
*
* fill(Array(3), 2);
* // => [2, 2, 2]
*
* fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* fill([1, 2, 3], '*', -2, -1);
* // => [1, '*', 3]
*/
function fill(array, value, start = 0, end = array.length) {
const length = array.length;
const finalStart = Math.max(start >= 0 ? start : length + start, 0);
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
for (let i = finalStart; i < finalEnd; i++) array[i] = value;
return array;
}
//#endregion
export { fill };

36
node_modules/es-toolkit/dist/array/filterAsync.d.mts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/filterAsync.d.ts
interface FilterAsyncOptions {
concurrency?: number;
}
/**
* Filters an array asynchronously using an async predicate function.
*
* Returns a promise that resolves to a new array containing only the elements
* for which the predicate function returns a truthy value.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to filter.
* @param {(item: T, index: number, array: readonly T[]) => Promise<boolean>} predicate An async function that tests each element.
* @param {FilterAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<T[]>} A promise that resolves to the filtered array.
* @example
* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }];
* const activeUsers = await filterAsync(users, async (user) => {
* return await checkUserStatus(user.id);
* });
* // Returns: [{ id: 1, active: true }, { id: 3, active: true }]
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3, 4, 5];
* const evenNumbers = await filterAsync(
* numbers,
* async (n) => await isEvenAsync(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
declare function filterAsync<T>(array: readonly T[], predicate: (item: T, index: number, array: readonly T[]) => Promise<boolean>, options?: FilterAsyncOptions): Promise<T[]>;
//#endregion
export { filterAsync };

36
node_modules/es-toolkit/dist/array/filterAsync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/filterAsync.d.ts
interface FilterAsyncOptions {
concurrency?: number;
}
/**
* Filters an array asynchronously using an async predicate function.
*
* Returns a promise that resolves to a new array containing only the elements
* for which the predicate function returns a truthy value.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to filter.
* @param {(item: T, index: number, array: readonly T[]) => Promise<boolean>} predicate An async function that tests each element.
* @param {FilterAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<T[]>} A promise that resolves to the filtered array.
* @example
* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }];
* const activeUsers = await filterAsync(users, async (user) => {
* return await checkUserStatus(user.id);
* });
* // Returns: [{ id: 1, active: true }, { id: 3, active: true }]
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3, 4, 5];
* const evenNumbers = await filterAsync(
* numbers,
* async (n) => await isEvenAsync(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
declare function filterAsync<T>(array: readonly T[], predicate: (item: T, index: number, array: readonly T[]) => Promise<boolean>, options?: FilterAsyncOptions): Promise<T[]>;
//#endregion
export { filterAsync };

38
node_modules/es-toolkit/dist/array/filterAsync.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
const require_limitAsync = require("./limitAsync.js");
//#region src/array/filterAsync.ts
/**
* Filters an array asynchronously using an async predicate function.
*
* Returns a promise that resolves to a new array containing only the elements
* for which the predicate function returns a truthy value.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to filter.
* @param {(item: T, index: number, array: readonly T[]) => Promise<boolean>} predicate An async function that tests each element.
* @param {FilterAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<T[]>} A promise that resolves to the filtered array.
* @example
* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }];
* const activeUsers = await filterAsync(users, async (user) => {
* return await checkUserStatus(user.id);
* });
* // Returns: [{ id: 1, active: true }, { id: 3, active: true }]
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3, 4, 5];
* const evenNumbers = await filterAsync(
* numbers,
* async (n) => await isEvenAsync(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
async function filterAsync(array, predicate, options) {
if (options?.concurrency != null) predicate = require_limitAsync.limitAsync(predicate, options.concurrency);
const results = await Promise.all(array.map(predicate));
return array.filter((_, index) => results[index]);
}
//#endregion
exports.filterAsync = filterAsync;

38
node_modules/es-toolkit/dist/array/filterAsync.mjs generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import { limitAsync } from "./limitAsync.mjs";
//#region src/array/filterAsync.ts
/**
* Filters an array asynchronously using an async predicate function.
*
* Returns a promise that resolves to a new array containing only the elements
* for which the predicate function returns a truthy value.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to filter.
* @param {(item: T, index: number, array: readonly T[]) => Promise<boolean>} predicate An async function that tests each element.
* @param {FilterAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<T[]>} A promise that resolves to the filtered array.
* @example
* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }];
* const activeUsers = await filterAsync(users, async (user) => {
* return await checkUserStatus(user.id);
* });
* // Returns: [{ id: 1, active: true }, { id: 3, active: true }]
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3, 4, 5];
* const evenNumbers = await filterAsync(
* numbers,
* async (n) => await isEvenAsync(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
async function filterAsync(array, predicate, options) {
if (options?.concurrency != null) predicate = limitAsync(predicate, options.concurrency);
const results = await Promise.all(array.map(predicate));
return array.filter((_, index) => results[index]);
}
//#endregion
export { filterAsync };

24
node_modules/es-toolkit/dist/array/flatMap.d.mts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
//#region src/array/flatMap.d.ts
/**
* Maps each element in the array using the iteratee function and flattens the result up to the specified depth.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<U[], D>>} The new array with the mapped and flattened elements.
*
* @example
* const arr = [1, 2, 3];
*
* flatMap(arr, (item: number) => [item, item]);
* // [1, 1, 2, 2, 3, 3]
*
* flatMap(arr, (item: number) => [[item, item]], 2);
* // [1, 1, 2, 2, 3, 3]
*/
declare function flatMap<T, U, D extends number = 1>(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U, depth?: D): Array<FlatArray<U[], D>>;
//#endregion
export { flatMap };

24
node_modules/es-toolkit/dist/array/flatMap.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
//#region src/array/flatMap.d.ts
/**
* Maps each element in the array using the iteratee function and flattens the result up to the specified depth.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<U[], D>>} The new array with the mapped and flattened elements.
*
* @example
* const arr = [1, 2, 3];
*
* flatMap(arr, (item: number) => [item, item]);
* // [1, 1, 2, 2, 3, 3]
*
* flatMap(arr, (item: number) => [[item, item]], 2);
* // [1, 1, 2, 2, 3, 3]
*/
declare function flatMap<T, U, D extends number = 1>(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U, depth?: D): Array<FlatArray<U[], D>>;
//#endregion
export { flatMap };

27
node_modules/es-toolkit/dist/array/flatMap.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
const require_flatten = require("./flatten.js");
//#region src/array/flatMap.ts
/**
* Maps each element in the array using the iteratee function and flattens the result up to the specified depth.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<U[], D>>} The new array with the mapped and flattened elements.
*
* @example
* const arr = [1, 2, 3];
*
* flatMap(arr, (item: number) => [item, item]);
* // [1, 1, 2, 2, 3, 3]
*
* flatMap(arr, (item: number) => [[item, item]], 2);
* // [1, 1, 2, 2, 3, 3]
*/
function flatMap(arr, iteratee, depth = 1) {
return require_flatten.flatten(arr.map((item, index) => iteratee(item, index, arr)), depth);
}
//#endregion
exports.flatMap = flatMap;

27
node_modules/es-toolkit/dist/array/flatMap.mjs generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import { flatten } from "./flatten.mjs";
//#region src/array/flatMap.ts
/**
* Maps each element in the array using the iteratee function and flattens the result up to the specified depth.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<U[], D>>} The new array with the mapped and flattened elements.
*
* @example
* const arr = [1, 2, 3];
*
* flatMap(arr, (item: number) => [item, item]);
* // [1, 1, 2, 2, 3, 3]
*
* flatMap(arr, (item: number) => [[item, item]], 2);
* // [1, 1, 2, 2, 3, 3]
*/
function flatMap(arr, iteratee, depth = 1) {
return flatten(arr.map((item, index) => iteratee(item, index, arr)), depth);
}
//#endregion
export { flatMap };

38
node_modules/es-toolkit/dist/array/flatMapAsync.d.mts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/flatMapAsync.d.ts
interface FlatMapAsyncOptions {
concurrency?: number;
}
/**
* Maps each element in an array using an async callback function and flattens the result by one level.
*
* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient.
* Each callback should return an array, and all returned arrays are concatenated into
* a single output array.
*
* @template T - The type of elements in the input array.
* @template R - The type of elements in the arrays returned by the callback.
* @param {readonly T[]} array The array to transform.
* @param {(item: T, index: number, array: readonly T[]) => Promise<R[]>} callback An async function that transforms each element into an array.
* @param {FlatMapAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<R[]>} A promise that resolves to a flattened array of transformed values.
* @example
* const users = [{ id: 1 }, { id: 2 }];
* const allPosts = await flatMapAsync(users, async (user) => {
* return await fetchUserPosts(user.id);
* });
* // Returns: [post1, post2, post3, ...] (all posts from all users)
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3];
* const results = await flatMapAsync(
* numbers,
* async (n) => await fetchRelatedItems(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
declare function flatMapAsync<T, R>(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise<R[]>, options?: FlatMapAsyncOptions): Promise<R[]>;
//#endregion
export { flatMapAsync };

38
node_modules/es-toolkit/dist/array/flatMapAsync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
//#region src/array/flatMapAsync.d.ts
interface FlatMapAsyncOptions {
concurrency?: number;
}
/**
* Maps each element in an array using an async callback function and flattens the result by one level.
*
* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient.
* Each callback should return an array, and all returned arrays are concatenated into
* a single output array.
*
* @template T - The type of elements in the input array.
* @template R - The type of elements in the arrays returned by the callback.
* @param {readonly T[]} array The array to transform.
* @param {(item: T, index: number, array: readonly T[]) => Promise<R[]>} callback An async function that transforms each element into an array.
* @param {FlatMapAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<R[]>} A promise that resolves to a flattened array of transformed values.
* @example
* const users = [{ id: 1 }, { id: 2 }];
* const allPosts = await flatMapAsync(users, async (user) => {
* return await fetchUserPosts(user.id);
* });
* // Returns: [post1, post2, post3, ...] (all posts from all users)
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3];
* const results = await flatMapAsync(
* numbers,
* async (n) => await fetchRelatedItems(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
declare function flatMapAsync<T, R>(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise<R[]>, options?: FlatMapAsyncOptions): Promise<R[]>;
//#endregion
export { flatMapAsync };

41
node_modules/es-toolkit/dist/array/flatMapAsync.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
const require_limitAsync = require("./limitAsync.js");
const require_flatten = require("./flatten.js");
//#region src/array/flatMapAsync.ts
/**
* Maps each element in an array using an async callback function and flattens the result by one level.
*
* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient.
* Each callback should return an array, and all returned arrays are concatenated into
* a single output array.
*
* @template T - The type of elements in the input array.
* @template R - The type of elements in the arrays returned by the callback.
* @param {readonly T[]} array The array to transform.
* @param {(item: T, index: number, array: readonly T[]) => Promise<R[]>} callback An async function that transforms each element into an array.
* @param {FlatMapAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<R[]>} A promise that resolves to a flattened array of transformed values.
* @example
* const users = [{ id: 1 }, { id: 2 }];
* const allPosts = await flatMapAsync(users, async (user) => {
* return await fetchUserPosts(user.id);
* });
* // Returns: [post1, post2, post3, ...] (all posts from all users)
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3];
* const results = await flatMapAsync(
* numbers,
* async (n) => await fetchRelatedItems(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
async function flatMapAsync(array, callback, options) {
if (options?.concurrency != null) callback = require_limitAsync.limitAsync(callback, options.concurrency);
const results = await Promise.all(array.map(callback));
return require_flatten.flatten(results);
}
//#endregion
exports.flatMapAsync = flatMapAsync;

40
node_modules/es-toolkit/dist/array/flatMapAsync.mjs generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import { limitAsync } from "./limitAsync.mjs";
import { flatten } from "./flatten.mjs";
//#region src/array/flatMapAsync.ts
/**
* Maps each element in an array using an async callback function and flattens the result by one level.
*
* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient.
* Each callback should return an array, and all returned arrays are concatenated into
* a single output array.
*
* @template T - The type of elements in the input array.
* @template R - The type of elements in the arrays returned by the callback.
* @param {readonly T[]} array The array to transform.
* @param {(item: T, index: number, array: readonly T[]) => Promise<R[]>} callback An async function that transforms each element into an array.
* @param {FlatMapAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<R[]>} A promise that resolves to a flattened array of transformed values.
* @example
* const users = [{ id: 1 }, { id: 2 }];
* const allPosts = await flatMapAsync(users, async (user) => {
* return await fetchUserPosts(user.id);
* });
* // Returns: [post1, post2, post3, ...] (all posts from all users)
*
* @example
* // With concurrency limit
* const numbers = [1, 2, 3];
* const results = await flatMapAsync(
* numbers,
* async (n) => await fetchRelatedItems(n),
* { concurrency: 2 }
* );
* // Processes at most 2 operations concurrently
*/
async function flatMapAsync(array, callback, options) {
if (options?.concurrency != null) callback = limitAsync(callback, options.concurrency);
return flatten(await Promise.all(array.map(callback)));
}
//#endregion
export { flatMapAsync };

19
node_modules/es-toolkit/dist/array/flatMapDeep.d.mts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { ExtractNestedArrayType } from "./flattenDeep.mjs";
//#region src/array/flatMapDeep.d.ts
/**
* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @returns {Array<ExtractNestedArrayType<U>>} A new array that has been flattened.
*
* @example
* const result = flatMapDeep([1, 2, 3], n => [[n, n]]);
* // [1, 1, 2, 2, 3, 3]
*/
declare function flatMapDeep<T, U>(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U): Array<ExtractNestedArrayType<U>>;
//#endregion
export { flatMapDeep };

19
node_modules/es-toolkit/dist/array/flatMapDeep.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { ExtractNestedArrayType } from "./flattenDeep.js";
//#region src/array/flatMapDeep.d.ts
/**
* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @returns {Array<ExtractNestedArrayType<U>>} A new array that has been flattened.
*
* @example
* const result = flatMapDeep([1, 2, 3], n => [[n, n]]);
* // [1, 1, 2, 2, 3, 3]
*/
declare function flatMapDeep<T, U>(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U): Array<ExtractNestedArrayType<U>>;
//#endregion
export { flatMapDeep };

20
node_modules/es-toolkit/dist/array/flatMapDeep.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
const require_flattenDeep = require("./flattenDeep.js");
//#region src/array/flatMapDeep.ts
/**
* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @returns {Array<ExtractNestedArrayType<U>>} A new array that has been flattened.
*
* @example
* const result = flatMapDeep([1, 2, 3], n => [[n, n]]);
* // [1, 1, 2, 2, 3, 3]
*/
function flatMapDeep(arr, iteratee) {
return require_flattenDeep.flattenDeep(arr.map((item, index) => iteratee(item, index, arr)));
}
//#endregion
exports.flatMapDeep = flatMapDeep;

20
node_modules/es-toolkit/dist/array/flatMapDeep.mjs generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { flattenDeep } from "./flattenDeep.mjs";
//#region src/array/flatMapDeep.ts
/**
* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array.
*
* @template T - The type of elements within the array.
* @template U - The type of elements within the returned array from the iteratee function.
* @param {T[]} arr - The array to flatten.
* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array.
* @returns {Array<ExtractNestedArrayType<U>>} A new array that has been flattened.
*
* @example
* const result = flatMapDeep([1, 2, 3], n => [[n, n]]);
* // [1, 1, 2, 2, 3, 3]
*/
function flatMapDeep(arr, iteratee) {
return flattenDeep(arr.map((item, index) => iteratee(item, index, arr)));
}
//#endregion
export { flatMapDeep };

20
node_modules/es-toolkit/dist/array/flatten.d.mts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/flatten.d.ts
/**
* Flattens an array up to the specified depth.
*
* @template T - The type of elements within the array.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<T[], D>>} A new array that has been flattened.
*
* @example
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);
* // Returns: [1, 2, 3, 4, [5, 6]]
*
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
declare function flatten<T, D extends number = 1>(arr: readonly T[], depth?: D): Array<FlatArray<T[], D>>;
//#endregion
export { flatten };

20
node_modules/es-toolkit/dist/array/flatten.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
//#region src/array/flatten.d.ts
/**
* Flattens an array up to the specified depth.
*
* @template T - The type of elements within the array.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<T[], D>>} A new array that has been flattened.
*
* @example
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);
* // Returns: [1, 2, 3, 4, [5, 6]]
*
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
declare function flatten<T, D extends number = 1>(arr: readonly T[], depth?: D): Array<FlatArray<T[], D>>;
//#endregion
export { flatten };

32
node_modules/es-toolkit/dist/array/flatten.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
//#region src/array/flatten.ts
/**
* Flattens an array up to the specified depth.
*
* @template T - The type of elements within the array.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<T[], D>>} A new array that has been flattened.
*
* @example
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);
* // Returns: [1, 2, 3, 4, [5, 6]]
*
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
function flatten(arr, depth = 1) {
const result = [];
const flooredDepth = Math.floor(depth);
const recursive = (arr, currentDepth) => {
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (Array.isArray(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1);
else result.push(item);
}
};
recursive(arr, 0);
return result;
}
//#endregion
exports.flatten = flatten;

32
node_modules/es-toolkit/dist/array/flatten.mjs generated vendored Normal file
View File

@@ -0,0 +1,32 @@
//#region src/array/flatten.ts
/**
* Flattens an array up to the specified depth.
*
* @template T - The type of elements within the array.
* @template D - The depth to which the array should be flattened.
* @param {T[]} arr - The array to flatten.
* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
* @returns {Array<FlatArray<T[], D>>} A new array that has been flattened.
*
* @example
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);
* // Returns: [1, 2, 3, 4, [5, 6]]
*
* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
function flatten(arr, depth = 1) {
const result = [];
const flooredDepth = Math.floor(depth);
const recursive = (arr, currentDepth) => {
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (Array.isArray(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1);
else result.push(item);
}
};
recursive(arr, 0);
return result;
}
//#endregion
export { flatten };

26
node_modules/es-toolkit/dist/array/flattenDeep.d.mts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/flattenDeep.d.ts
/**
* Utility type for recursively unpacking nested array types to extract the type of the innermost element
*
* @example
* ExtractNestedArrayType<(number | (number | number[])[])[]>
* // number
*
* ExtractNestedArrayType<(boolean | (string | number[])[])[]>
* // string | number | boolean
*/
type ExtractNestedArrayType<T> = T extends ReadonlyArray<infer U> ? ExtractNestedArrayType<U> : T;
/**
* Flattens all depths of a nested array.
*
* @template T - The type of elements within the array.
* @param {T[]} arr - The array to flatten.
* @returns {Array<ExtractNestedArrayType<T>>} A new array that has been flattened.
*
* @example
* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
declare function flattenDeep<T>(arr: readonly T[]): Array<ExtractNestedArrayType<T>>;
//#endregion
export { ExtractNestedArrayType, flattenDeep };

26
node_modules/es-toolkit/dist/array/flattenDeep.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/array/flattenDeep.d.ts
/**
* Utility type for recursively unpacking nested array types to extract the type of the innermost element
*
* @example
* ExtractNestedArrayType<(number | (number | number[])[])[]>
* // number
*
* ExtractNestedArrayType<(boolean | (string | number[])[])[]>
* // string | number | boolean
*/
type ExtractNestedArrayType<T> = T extends ReadonlyArray<infer U> ? ExtractNestedArrayType<U> : T;
/**
* Flattens all depths of a nested array.
*
* @template T - The type of elements within the array.
* @param {T[]} arr - The array to flatten.
* @returns {Array<ExtractNestedArrayType<T>>} A new array that has been flattened.
*
* @example
* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
declare function flattenDeep<T>(arr: readonly T[]): Array<ExtractNestedArrayType<T>>;
//#endregion
export { ExtractNestedArrayType, flattenDeep };

18
node_modules/es-toolkit/dist/array/flattenDeep.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
const require_flatten = require("./flatten.js");
//#region src/array/flattenDeep.ts
/**
* Flattens all depths of a nested array.
*
* @template T - The type of elements within the array.
* @param {T[]} arr - The array to flatten.
* @returns {Array<ExtractNestedArrayType<T>>} A new array that has been flattened.
*
* @example
* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
function flattenDeep(arr) {
return require_flatten.flatten(arr, Infinity);
}
//#endregion
exports.flattenDeep = flattenDeep;

18
node_modules/es-toolkit/dist/array/flattenDeep.mjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import { flatten } from "./flatten.mjs";
//#region src/array/flattenDeep.ts
/**
* Flattens all depths of a nested array.
*
* @template T - The type of elements within the array.
* @param {T[]} arr - The array to flatten.
* @returns {Array<ExtractNestedArrayType<T>>} A new array that has been flattened.
*
* @example
* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]);
* // Returns: [1, 2, 3, 4, 5, 6]
*/
function flattenDeep(arr) {
return flatten(arr, Infinity);
}
//#endregion
export { flattenDeep };

36
node_modules/es-toolkit/dist/array/forEachAsync.d.mts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/forEachAsync.d.ts
interface ForEachAsyncOptions {
concurrency?: number;
}
/**
* Executes an async callback function for each element in an array.
*
* Unlike the native `forEach`, this function returns a promise that resolves
* when all async operations complete. It supports optional concurrency limiting.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to iterate over.
* @param {(item: T, index: number, array: readonly T[]) => Promise<void>} callback An async function to execute for each element.
* @param {ForEachAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<void>} A promise that resolves when all operations complete.
* @example
* const users = [{ id: 1 }, { id: 2 }, { id: 3 }];
* await forEachAsync(users, async (user) => {
* await updateUser(user.id);
* });
* // All users have been updated
*
* @example
* // With concurrency limit
* const items = [1, 2, 3, 4, 5];
* await forEachAsync(
* items,
* async (item) => await processItem(item),
* { concurrency: 2 }
* );
* // Processes at most 2 items concurrently
*/
declare function forEachAsync<T>(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise<void>, options?: ForEachAsyncOptions): Promise<void>;
//#endregion
export { forEachAsync };

36
node_modules/es-toolkit/dist/array/forEachAsync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
//#region src/array/forEachAsync.d.ts
interface ForEachAsyncOptions {
concurrency?: number;
}
/**
* Executes an async callback function for each element in an array.
*
* Unlike the native `forEach`, this function returns a promise that resolves
* when all async operations complete. It supports optional concurrency limiting.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to iterate over.
* @param {(item: T, index: number, array: readonly T[]) => Promise<void>} callback An async function to execute for each element.
* @param {ForEachAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<void>} A promise that resolves when all operations complete.
* @example
* const users = [{ id: 1 }, { id: 2 }, { id: 3 }];
* await forEachAsync(users, async (user) => {
* await updateUser(user.id);
* });
* // All users have been updated
*
* @example
* // With concurrency limit
* const items = [1, 2, 3, 4, 5];
* await forEachAsync(
* items,
* async (item) => await processItem(item),
* { concurrency: 2 }
* );
* // Processes at most 2 items concurrently
*/
declare function forEachAsync<T>(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise<void>, options?: ForEachAsyncOptions): Promise<void>;
//#endregion
export { forEachAsync };

37
node_modules/es-toolkit/dist/array/forEachAsync.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
const require_limitAsync = require("./limitAsync.js");
//#region src/array/forEachAsync.ts
/**
* Executes an async callback function for each element in an array.
*
* Unlike the native `forEach`, this function returns a promise that resolves
* when all async operations complete. It supports optional concurrency limiting.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to iterate over.
* @param {(item: T, index: number, array: readonly T[]) => Promise<void>} callback An async function to execute for each element.
* @param {ForEachAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<void>} A promise that resolves when all operations complete.
* @example
* const users = [{ id: 1 }, { id: 2 }, { id: 3 }];
* await forEachAsync(users, async (user) => {
* await updateUser(user.id);
* });
* // All users have been updated
*
* @example
* // With concurrency limit
* const items = [1, 2, 3, 4, 5];
* await forEachAsync(
* items,
* async (item) => await processItem(item),
* { concurrency: 2 }
* );
* // Processes at most 2 items concurrently
*/
async function forEachAsync(array, callback, options) {
if (options?.concurrency != null) callback = require_limitAsync.limitAsync(callback, options.concurrency);
await Promise.all(array.map(callback));
}
//#endregion
exports.forEachAsync = forEachAsync;

37
node_modules/es-toolkit/dist/array/forEachAsync.mjs generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import { limitAsync } from "./limitAsync.mjs";
//#region src/array/forEachAsync.ts
/**
* Executes an async callback function for each element in an array.
*
* Unlike the native `forEach`, this function returns a promise that resolves
* when all async operations complete. It supports optional concurrency limiting.
*
* @template T - The type of elements in the array.
* @param {readonly T[]} array The array to iterate over.
* @param {(item: T, index: number, array: readonly T[]) => Promise<void>} callback An async function to execute for each element.
* @param {ForEachAsyncOptions} [options] Optional configuration object.
* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently.
* @returns {Promise<void>} A promise that resolves when all operations complete.
* @example
* const users = [{ id: 1 }, { id: 2 }, { id: 3 }];
* await forEachAsync(users, async (user) => {
* await updateUser(user.id);
* });
* // All users have been updated
*
* @example
* // With concurrency limit
* const items = [1, 2, 3, 4, 5];
* await forEachAsync(
* items,
* async (item) => await processItem(item),
* { concurrency: 2 }
* );
* // Processes at most 2 items concurrently
*/
async function forEachAsync(array, callback, options) {
if (options?.concurrency != null) callback = limitAsync(callback, options.concurrency);
await Promise.all(array.map(callback));
}
//#endregion
export { forEachAsync };

49
node_modules/es-toolkit/dist/array/forEachRight.d.mts generated vendored Normal file
View File

@@ -0,0 +1,49 @@
//#region src/array/forEachRight.d.ts
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
declare function forEachRight<T>(arr: T[], callback: (value: T, index: number, arr: T[]) => void): void;
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
declare function forEachRight<T>(arr: readonly T[], callback: (value: T, index: number, arr: readonly T[]) => void): void;
//#endregion
export { forEachRight };

49
node_modules/es-toolkit/dist/array/forEachRight.d.ts generated vendored Normal file
View File

@@ -0,0 +1,49 @@
//#region src/array/forEachRight.d.ts
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
declare function forEachRight<T>(arr: T[], callback: (value: T, index: number, arr: T[]) => void): void;
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
declare function forEachRight<T>(arr: readonly T[], callback: (value: T, index: number, arr: readonly T[]) => void): void;
//#endregion
export { forEachRight };

31
node_modules/es-toolkit/dist/array/forEachRight.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
//#region src/array/forEachRight.ts
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
function forEachRight(arr, callback) {
for (let i = arr.length - 1; i >= 0; i--) {
const element = arr[i];
callback(element, i, arr);
}
}
//#endregion
exports.forEachRight = forEachRight;

31
node_modules/es-toolkit/dist/array/forEachRight.mjs generated vendored Normal file
View File

@@ -0,0 +1,31 @@
//#region src/array/forEachRight.ts
/**
* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to iterate over.
* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration.
* The callback function receives three arguments:
* - 'value': The current element being processed in the array.
* - 'index': The index of the current element being processed in the array.
* - 'arr': The array 'forEachRight' was called upon.
*
* @example
* const array = [1, 2, 3];
* const result: number[] = [];
*
* // Use the forEachRight function to iterate through the array and add each element to the result array.
* forEachRight(array, (value) => {
* result.push(value);
* })
*
* console.log(result) // Output: [3, 2, 1]
*/
function forEachRight(arr, callback) {
for (let i = arr.length - 1; i >= 0; i--) {
const element = arr[i];
callback(element, i, arr);
}
}
//#endregion
export { forEachRight };

42
node_modules/es-toolkit/dist/array/groupBy.d.mts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
//#region src/array/groupBy.d.ts
/**
* Groups the elements of an array based on a provided key-generating function.
*
* This function takes an array and a function that generates a key from each element. It returns
* an object where the keys are the generated keys and the values are arrays of elements that share
* the same key.
*
* @template T - The type of elements in the array.
* @template K - The type of keys.
* @param {T[]} arr - The array to group.
* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array.
* @returns {Record<K, T[]>} An object where each key is associated with an array of elements that
* share that key.
*
* @example
* const array = [
* { category: 'fruit', name: 'apple' },
* { category: 'fruit', name: 'banana' },
* { category: 'vegetable', name: 'carrot' }
* ];
* const result = groupBy(array, item => item.category);
* // result will be:
* // {
* // fruit: [
* // { category: 'fruit', name: 'apple' },
* // { category: 'fruit', name: 'banana' }
* // ],
* // vegetable: [
* // { category: 'vegetable', name: 'carrot' }
* // ]
* // }
*
* @example
* // Using index parameter
* const items = ['a', 'b', 'c', 'd'];
* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd');
* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] }
*/
declare function groupBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record<K, T[]>;
//#endregion
export { groupBy };

42
node_modules/es-toolkit/dist/array/groupBy.d.ts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
//#region src/array/groupBy.d.ts
/**
* Groups the elements of an array based on a provided key-generating function.
*
* This function takes an array and a function that generates a key from each element. It returns
* an object where the keys are the generated keys and the values are arrays of elements that share
* the same key.
*
* @template T - The type of elements in the array.
* @template K - The type of keys.
* @param {T[]} arr - The array to group.
* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array.
* @returns {Record<K, T[]>} An object where each key is associated with an array of elements that
* share that key.
*
* @example
* const array = [
* { category: 'fruit', name: 'apple' },
* { category: 'fruit', name: 'banana' },
* { category: 'vegetable', name: 'carrot' }
* ];
* const result = groupBy(array, item => item.category);
* // result will be:
* // {
* // fruit: [
* // { category: 'fruit', name: 'apple' },
* // { category: 'fruit', name: 'banana' }
* // ],
* // vegetable: [
* // { category: 'vegetable', name: 'carrot' }
* // ]
* // }
*
* @example
* // Using index parameter
* const items = ['a', 'b', 'c', 'd'];
* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd');
* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] }
*/
declare function groupBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record<K, T[]>;
//#endregion
export { groupBy };

51
node_modules/es-toolkit/dist/array/groupBy.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
//#region src/array/groupBy.ts
/**
* Groups the elements of an array based on a provided key-generating function.
*
* This function takes an array and a function that generates a key from each element. It returns
* an object where the keys are the generated keys and the values are arrays of elements that share
* the same key.
*
* @template T - The type of elements in the array.
* @template K - The type of keys.
* @param {T[]} arr - The array to group.
* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array.
* @returns {Record<K, T[]>} An object where each key is associated with an array of elements that
* share that key.
*
* @example
* const array = [
* { category: 'fruit', name: 'apple' },
* { category: 'fruit', name: 'banana' },
* { category: 'vegetable', name: 'carrot' }
* ];
* const result = groupBy(array, item => item.category);
* // result will be:
* // {
* // fruit: [
* // { category: 'fruit', name: 'apple' },
* // { category: 'fruit', name: 'banana' }
* // ],
* // vegetable: [
* // { category: 'vegetable', name: 'carrot' }
* // ]
* // }
*
* @example
* // Using index parameter
* const items = ['a', 'b', 'c', 'd'];
* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd');
* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] }
*/
function groupBy(arr, getKeyFromItem) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = getKeyFromItem(item, i, arr);
if (!Object.hasOwn(result, key)) result[key] = [];
result[key].push(item);
}
return result;
}
//#endregion
exports.groupBy = groupBy;

51
node_modules/es-toolkit/dist/array/groupBy.mjs generated vendored Normal file
View File

@@ -0,0 +1,51 @@
//#region src/array/groupBy.ts
/**
* Groups the elements of an array based on a provided key-generating function.
*
* This function takes an array and a function that generates a key from each element. It returns
* an object where the keys are the generated keys and the values are arrays of elements that share
* the same key.
*
* @template T - The type of elements in the array.
* @template K - The type of keys.
* @param {T[]} arr - The array to group.
* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array.
* @returns {Record<K, T[]>} An object where each key is associated with an array of elements that
* share that key.
*
* @example
* const array = [
* { category: 'fruit', name: 'apple' },
* { category: 'fruit', name: 'banana' },
* { category: 'vegetable', name: 'carrot' }
* ];
* const result = groupBy(array, item => item.category);
* // result will be:
* // {
* // fruit: [
* // { category: 'fruit', name: 'apple' },
* // { category: 'fruit', name: 'banana' }
* // ],
* // vegetable: [
* // { category: 'vegetable', name: 'carrot' }
* // ]
* // }
*
* @example
* // Using index parameter
* const items = ['a', 'b', 'c', 'd'];
* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd');
* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] }
*/
function groupBy(arr, getKeyFromItem) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = getKeyFromItem(item, i, arr);
if (!Object.hasOwn(result, key)) result[key] = [];
result[key].push(item);
}
return result;
}
//#endregion
export { groupBy };

35
node_modules/es-toolkit/dist/array/head.d.mts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
//#region src/array/head.d.ts
/**
* Returns the first element of an array.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {[T, ...T[]]} arr - A non-empty array from which to get the first element.
* @returns {T} The first element of the array.
*
* @example
* const arr = [1, 2, 3];
* const firstElement = head(arr);
* // firstElement will be 1
*/
declare function head<T>(arr: readonly [T, ...T[]]): T;
/**
* Returns the first element of an array or `undefined` if the array is empty.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to get the first element.
* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty.
*
* @example
* const emptyArr: number[] = [];
* const noElement = head(emptyArr);
* // noElement will be undefined
*/
declare function head<T>(arr: readonly T[]): T | undefined;
//#endregion
export { head };

35
node_modules/es-toolkit/dist/array/head.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
//#region src/array/head.d.ts
/**
* Returns the first element of an array.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {[T, ...T[]]} arr - A non-empty array from which to get the first element.
* @returns {T} The first element of the array.
*
* @example
* const arr = [1, 2, 3];
* const firstElement = head(arr);
* // firstElement will be 1
*/
declare function head<T>(arr: readonly [T, ...T[]]): T;
/**
* Returns the first element of an array or `undefined` if the array is empty.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to get the first element.
* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty.
*
* @example
* const emptyArr: number[] = [];
* const noElement = head(emptyArr);
* // noElement will be undefined
*/
declare function head<T>(arr: readonly T[]): T | undefined;
//#endregion
export { head };

21
node_modules/es-toolkit/dist/array/head.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
//#region src/array/head.ts
/**
* Returns the first element of an array or `undefined` if the array is empty.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to get the first element.
* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty.
*
* @example
* const emptyArr: number[] = [];
* const noElement = head(emptyArr);
* // noElement will be undefined
*/
function head(arr) {
return arr[0];
}
//#endregion
exports.head = head;

21
node_modules/es-toolkit/dist/array/head.mjs generated vendored Normal file
View File

@@ -0,0 +1,21 @@
//#region src/array/head.ts
/**
* Returns the first element of an array or `undefined` if the array is empty.
*
* This function takes an array and returns the first element of the array.
* If the array is empty, the function returns `undefined`.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array from which to get the first element.
* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty.
*
* @example
* const emptyArr: number[] = [];
* const noElement = head(emptyArr);
* // noElement will be undefined
*/
function head(arr) {
return arr[0];
}
//#endregion
export { head };

69
node_modules/es-toolkit/dist/array/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import { at } from "./at.mjs";
import { cartesianProduct } from "./cartesianProduct.mjs";
import { chunk } from "./chunk.mjs";
import { combinations } from "./combinations.mjs";
import { compact } from "./compact.mjs";
import { countBy } from "./countBy.mjs";
import { difference } from "./difference.mjs";
import { differenceBy } from "./differenceBy.mjs";
import { differenceWith } from "./differenceWith.mjs";
import { drop } from "./drop.mjs";
import { dropRight } from "./dropRight.mjs";
import { dropRightWhile } from "./dropRightWhile.mjs";
import { dropWhile } from "./dropWhile.mjs";
import { fill } from "./fill.mjs";
import { filterAsync } from "./filterAsync.mjs";
import { flatMap } from "./flatMap.mjs";
import { flatMapAsync } from "./flatMapAsync.mjs";
import { flattenDeep } from "./flattenDeep.mjs";
import { flatMapDeep } from "./flatMapDeep.mjs";
import { flatten } from "./flatten.mjs";
import { forEachAsync } from "./forEachAsync.mjs";
import { forEachRight } from "./forEachRight.mjs";
import { groupBy } from "./groupBy.mjs";
import { head } from "./head.mjs";
import { initial } from "./initial.mjs";
import { intersection } from "./intersection.mjs";
import { intersectionBy } from "./intersectionBy.mjs";
import { intersectionWith } from "./intersectionWith.mjs";
import { isSubset } from "./isSubset.mjs";
import { isSubsetWith } from "./isSubsetWith.mjs";
import { keyBy } from "./keyBy.mjs";
import { last } from "./last.mjs";
import { limitAsync } from "./limitAsync.mjs";
import { mapAsync } from "./mapAsync.mjs";
import { maxBy } from "./maxBy.mjs";
import { minBy } from "./minBy.mjs";
import { orderBy } from "./orderBy.mjs";
import { partition } from "./partition.mjs";
import { pull } from "./pull.mjs";
import { pullAt } from "./pullAt.mjs";
import { reduceAsync } from "./reduceAsync.mjs";
import { remove } from "./remove.mjs";
import { sample } from "./sample.mjs";
import { sampleSize } from "./sampleSize.mjs";
import { shuffle } from "./shuffle.mjs";
import { sortBy } from "./sortBy.mjs";
import { tail } from "./tail.mjs";
import { take } from "./take.mjs";
import { takeRight } from "./takeRight.mjs";
import { takeRightWhile } from "./takeRightWhile.mjs";
import { takeWhile } from "./takeWhile.mjs";
import { toFilled } from "./toFilled.mjs";
import { union } from "./union.mjs";
import { unionBy } from "./unionBy.mjs";
import { unionWith } from "./unionWith.mjs";
import { uniq } from "./uniq.mjs";
import { uniqBy } from "./uniqBy.mjs";
import { uniqWith } from "./uniqWith.mjs";
import { unzip } from "./unzip.mjs";
import { unzipWith } from "./unzipWith.mjs";
import { windowed } from "./windowed.mjs";
import { without } from "./without.mjs";
import { xor } from "./xor.mjs";
import { xorBy } from "./xorBy.mjs";
import { xorWith } from "./xorWith.mjs";
import { zip } from "./zip.mjs";
import { zipObject } from "./zipObject.mjs";
import { zipWith } from "./zipWith.mjs";
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };

69
node_modules/es-toolkit/dist/array/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import { at } from "./at.js";
import { cartesianProduct } from "./cartesianProduct.js";
import { chunk } from "./chunk.js";
import { combinations } from "./combinations.js";
import { compact } from "./compact.js";
import { countBy } from "./countBy.js";
import { difference } from "./difference.js";
import { differenceBy } from "./differenceBy.js";
import { differenceWith } from "./differenceWith.js";
import { drop } from "./drop.js";
import { dropRight } from "./dropRight.js";
import { dropRightWhile } from "./dropRightWhile.js";
import { dropWhile } from "./dropWhile.js";
import { fill } from "./fill.js";
import { filterAsync } from "./filterAsync.js";
import { flatMap } from "./flatMap.js";
import { flatMapAsync } from "./flatMapAsync.js";
import { flattenDeep } from "./flattenDeep.js";
import { flatMapDeep } from "./flatMapDeep.js";
import { flatten } from "./flatten.js";
import { forEachAsync } from "./forEachAsync.js";
import { forEachRight } from "./forEachRight.js";
import { groupBy } from "./groupBy.js";
import { head } from "./head.js";
import { initial } from "./initial.js";
import { intersection } from "./intersection.js";
import { intersectionBy } from "./intersectionBy.js";
import { intersectionWith } from "./intersectionWith.js";
import { isSubset } from "./isSubset.js";
import { isSubsetWith } from "./isSubsetWith.js";
import { keyBy } from "./keyBy.js";
import { last } from "./last.js";
import { limitAsync } from "./limitAsync.js";
import { mapAsync } from "./mapAsync.js";
import { maxBy } from "./maxBy.js";
import { minBy } from "./minBy.js";
import { orderBy } from "./orderBy.js";
import { partition } from "./partition.js";
import { pull } from "./pull.js";
import { pullAt } from "./pullAt.js";
import { reduceAsync } from "./reduceAsync.js";
import { remove } from "./remove.js";
import { sample } from "./sample.js";
import { sampleSize } from "./sampleSize.js";
import { shuffle } from "./shuffle.js";
import { sortBy } from "./sortBy.js";
import { tail } from "./tail.js";
import { take } from "./take.js";
import { takeRight } from "./takeRight.js";
import { takeRightWhile } from "./takeRightWhile.js";
import { takeWhile } from "./takeWhile.js";
import { toFilled } from "./toFilled.js";
import { union } from "./union.js";
import { unionBy } from "./unionBy.js";
import { unionWith } from "./unionWith.js";
import { uniq } from "./uniq.js";
import { uniqBy } from "./uniqBy.js";
import { uniqWith } from "./uniqWith.js";
import { unzip } from "./unzip.js";
import { unzipWith } from "./unzipWith.js";
import { windowed } from "./windowed.js";
import { without } from "./without.js";
import { xor } from "./xor.js";
import { xorBy } from "./xorBy.js";
import { xorWith } from "./xorWith.js";
import { zip } from "./zip.js";
import { zipObject } from "./zipObject.js";
import { zipWith } from "./zipWith.js";
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };

137
node_modules/es-toolkit/dist/array/index.js generated vendored Normal file
View File

@@ -0,0 +1,137 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_at = require("./at.js");
const require_cartesianProduct = require("./cartesianProduct.js");
const require_chunk = require("./chunk.js");
const require_combinations = require("./combinations.js");
const require_compact = require("./compact.js");
const require_countBy = require("./countBy.js");
const require_difference = require("./difference.js");
const require_differenceBy = require("./differenceBy.js");
const require_differenceWith = require("./differenceWith.js");
const require_drop = require("./drop.js");
const require_dropRight = require("./dropRight.js");
const require_dropRightWhile = require("./dropRightWhile.js");
const require_dropWhile = require("./dropWhile.js");
const require_fill = require("./fill.js");
const require_limitAsync = require("./limitAsync.js");
const require_filterAsync = require("./filterAsync.js");
const require_flatten = require("./flatten.js");
const require_flatMap = require("./flatMap.js");
const require_flatMapAsync = require("./flatMapAsync.js");
const require_flattenDeep = require("./flattenDeep.js");
const require_flatMapDeep = require("./flatMapDeep.js");
const require_forEachAsync = require("./forEachAsync.js");
const require_forEachRight = require("./forEachRight.js");
const require_groupBy = require("./groupBy.js");
const require_head = require("./head.js");
const require_initial = require("./initial.js");
const require_intersection = require("./intersection.js");
const require_intersectionBy = require("./intersectionBy.js");
const require_intersectionWith = require("./intersectionWith.js");
const require_isSubset = require("./isSubset.js");
const require_isSubsetWith = require("./isSubsetWith.js");
const require_keyBy = require("./keyBy.js");
const require_last = require("./last.js");
const require_mapAsync = require("./mapAsync.js");
const require_maxBy = require("./maxBy.js");
const require_minBy = require("./minBy.js");
const require_orderBy = require("./orderBy.js");
const require_partition = require("./partition.js");
const require_pull = require("./pull.js");
const require_pullAt = require("./pullAt.js");
const require_reduceAsync = require("./reduceAsync.js");
const require_remove = require("./remove.js");
const require_sample = require("./sample.js");
const require_sampleSize = require("./sampleSize.js");
const require_shuffle = require("./shuffle.js");
const require_sortBy = require("./sortBy.js");
const require_tail = require("./tail.js");
const require_take = require("./take.js");
const require_takeRight = require("./takeRight.js");
const require_takeRightWhile = require("./takeRightWhile.js");
const require_takeWhile = require("./takeWhile.js");
const require_toFilled = require("./toFilled.js");
const require_uniq = require("./uniq.js");
const require_union = require("./union.js");
const require_uniqBy = require("./uniqBy.js");
const require_unionBy = require("./unionBy.js");
const require_uniqWith = require("./uniqWith.js");
const require_unionWith = require("./unionWith.js");
const require_unzip = require("./unzip.js");
const require_unzipWith = require("./unzipWith.js");
const require_windowed = require("./windowed.js");
const require_without = require("./without.js");
const require_xor = require("./xor.js");
const require_xorBy = require("./xorBy.js");
const require_xorWith = require("./xorWith.js");
const require_zip = require("./zip.js");
const require_zipObject = require("./zipObject.js");
const require_zipWith = require("./zipWith.js");
exports.at = require_at.at;
exports.cartesianProduct = require_cartesianProduct.cartesianProduct;
exports.chunk = require_chunk.chunk;
exports.combinations = require_combinations.combinations;
exports.compact = require_compact.compact;
exports.countBy = require_countBy.countBy;
exports.difference = require_difference.difference;
exports.differenceBy = require_differenceBy.differenceBy;
exports.differenceWith = require_differenceWith.differenceWith;
exports.drop = require_drop.drop;
exports.dropRight = require_dropRight.dropRight;
exports.dropRightWhile = require_dropRightWhile.dropRightWhile;
exports.dropWhile = require_dropWhile.dropWhile;
exports.fill = require_fill.fill;
exports.filterAsync = require_filterAsync.filterAsync;
exports.flatMap = require_flatMap.flatMap;
exports.flatMapAsync = require_flatMapAsync.flatMapAsync;
exports.flatMapDeep = require_flatMapDeep.flatMapDeep;
exports.flatten = require_flatten.flatten;
exports.flattenDeep = require_flattenDeep.flattenDeep;
exports.forEachAsync = require_forEachAsync.forEachAsync;
exports.forEachRight = require_forEachRight.forEachRight;
exports.groupBy = require_groupBy.groupBy;
exports.head = require_head.head;
exports.initial = require_initial.initial;
exports.intersection = require_intersection.intersection;
exports.intersectionBy = require_intersectionBy.intersectionBy;
exports.intersectionWith = require_intersectionWith.intersectionWith;
exports.isSubset = require_isSubset.isSubset;
exports.isSubsetWith = require_isSubsetWith.isSubsetWith;
exports.keyBy = require_keyBy.keyBy;
exports.last = require_last.last;
exports.limitAsync = require_limitAsync.limitAsync;
exports.mapAsync = require_mapAsync.mapAsync;
exports.maxBy = require_maxBy.maxBy;
exports.minBy = require_minBy.minBy;
exports.orderBy = require_orderBy.orderBy;
exports.partition = require_partition.partition;
exports.pull = require_pull.pull;
exports.pullAt = require_pullAt.pullAt;
exports.reduceAsync = require_reduceAsync.reduceAsync;
exports.remove = require_remove.remove;
exports.sample = require_sample.sample;
exports.sampleSize = require_sampleSize.sampleSize;
exports.shuffle = require_shuffle.shuffle;
exports.sortBy = require_sortBy.sortBy;
exports.tail = require_tail.tail;
exports.take = require_take.take;
exports.takeRight = require_takeRight.takeRight;
exports.takeRightWhile = require_takeRightWhile.takeRightWhile;
exports.takeWhile = require_takeWhile.takeWhile;
exports.toFilled = require_toFilled.toFilled;
exports.union = require_union.union;
exports.unionBy = require_unionBy.unionBy;
exports.unionWith = require_unionWith.unionWith;
exports.uniq = require_uniq.uniq;
exports.uniqBy = require_uniqBy.uniqBy;
exports.uniqWith = require_uniqWith.uniqWith;
exports.unzip = require_unzip.unzip;
exports.unzipWith = require_unzipWith.unzipWith;
exports.windowed = require_windowed.windowed;
exports.without = require_without.without;
exports.xor = require_xor.xor;
exports.xorBy = require_xorBy.xorBy;
exports.xorWith = require_xorWith.xorWith;
exports.zip = require_zip.zip;
exports.zipObject = require_zipObject.zipObject;
exports.zipWith = require_zipWith.zipWith;

69
node_modules/es-toolkit/dist/array/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import { at } from "./at.mjs";
import { cartesianProduct } from "./cartesianProduct.mjs";
import { chunk } from "./chunk.mjs";
import { combinations } from "./combinations.mjs";
import { compact } from "./compact.mjs";
import { countBy } from "./countBy.mjs";
import { difference } from "./difference.mjs";
import { differenceBy } from "./differenceBy.mjs";
import { differenceWith } from "./differenceWith.mjs";
import { drop } from "./drop.mjs";
import { dropRight } from "./dropRight.mjs";
import { dropRightWhile } from "./dropRightWhile.mjs";
import { dropWhile } from "./dropWhile.mjs";
import { fill } from "./fill.mjs";
import { limitAsync } from "./limitAsync.mjs";
import { filterAsync } from "./filterAsync.mjs";
import { flatten } from "./flatten.mjs";
import { flatMap } from "./flatMap.mjs";
import { flatMapAsync } from "./flatMapAsync.mjs";
import { flattenDeep } from "./flattenDeep.mjs";
import { flatMapDeep } from "./flatMapDeep.mjs";
import { forEachAsync } from "./forEachAsync.mjs";
import { forEachRight } from "./forEachRight.mjs";
import { groupBy } from "./groupBy.mjs";
import { head } from "./head.mjs";
import { initial } from "./initial.mjs";
import { intersection } from "./intersection.mjs";
import { intersectionBy } from "./intersectionBy.mjs";
import { intersectionWith } from "./intersectionWith.mjs";
import { isSubset } from "./isSubset.mjs";
import { isSubsetWith } from "./isSubsetWith.mjs";
import { keyBy } from "./keyBy.mjs";
import { last } from "./last.mjs";
import { mapAsync } from "./mapAsync.mjs";
import { maxBy } from "./maxBy.mjs";
import { minBy } from "./minBy.mjs";
import { orderBy } from "./orderBy.mjs";
import { partition } from "./partition.mjs";
import { pull } from "./pull.mjs";
import { pullAt } from "./pullAt.mjs";
import { reduceAsync } from "./reduceAsync.mjs";
import { remove } from "./remove.mjs";
import { sample } from "./sample.mjs";
import { sampleSize } from "./sampleSize.mjs";
import { shuffle } from "./shuffle.mjs";
import { sortBy } from "./sortBy.mjs";
import { tail } from "./tail.mjs";
import { take } from "./take.mjs";
import { takeRight } from "./takeRight.mjs";
import { takeRightWhile } from "./takeRightWhile.mjs";
import { takeWhile } from "./takeWhile.mjs";
import { toFilled } from "./toFilled.mjs";
import { uniq } from "./uniq.mjs";
import { union } from "./union.mjs";
import { uniqBy } from "./uniqBy.mjs";
import { unionBy } from "./unionBy.mjs";
import { uniqWith } from "./uniqWith.mjs";
import { unionWith } from "./unionWith.mjs";
import { unzip } from "./unzip.mjs";
import { unzipWith } from "./unzipWith.mjs";
import { windowed } from "./windowed.mjs";
import { without } from "./without.mjs";
import { xor } from "./xor.mjs";
import { xorBy } from "./xorBy.mjs";
import { xorWith } from "./xorWith.mjs";
import { zip } from "./zip.mjs";
import { zipObject } from "./zipObject.mjs";
import { zipWith } from "./zipWith.mjs";
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };

Some files were not shown because too many files have changed in this diff Show More