Initial commit - Dutchie dispensary scraper

This commit is contained in:
Kelly
2025-11-28 19:45:44 -07:00
commit 5757a8e9bd
23375 changed files with 3788799 additions and 0 deletions

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

@@ -0,0 +1,18 @@
/**
* 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[];
export { at };

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

@@ -0,0 +1,18 @@
/**
* 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[];
export { at };

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

@@ -0,0 +1,19 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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;
}
exports.at = at;

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

@@ -0,0 +1,15 @@
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;
}
export { at };

View File

@@ -0,0 +1,26 @@
/**
* 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[][];
export { chunk };

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

@@ -0,0 +1,26 @@
/**
* 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[][];
export { chunk };

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

@@ -0,0 +1,19 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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;
}
exports.chunk = chunk;

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

@@ -0,0 +1,15 @@
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;
}
export { chunk };

View File

@@ -0,0 +1,15 @@
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>>;
export { compact };

View File

@@ -0,0 +1,15 @@
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>>;
export { compact };

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

@@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function compact(arr) {
const result = [];
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (item) {
result.push(item);
}
}
return result;
}
exports.compact = compact;

View File

@@ -0,0 +1,12 @@
function compact(arr) {
const result = [];
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (item) {
result.push(item);
}
}
return result;
}
export { compact };

View File

@@ -0,0 +1,30 @@
/**
* 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) => K} mapper - The transformation function that maps each item 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 }
*/
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T) => K): Record<K, number>;
export { countBy };

View File

@@ -0,0 +1,30 @@
/**
* 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) => K} mapper - The transformation function that maps each item 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 }
*/
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T) => K): Record<K, number>;
export { countBy };

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

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function countBy(arr, mapper) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = mapper(item);
result[key] = (result[key] ?? 0) + 1;
}
return result;
}
exports.countBy = countBy;

View File

@@ -0,0 +1,11 @@
function countBy(arr, mapper) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = mapper(item);
result[key] = (result[key] ?? 0) + 1;
}
return result;
}
export { countBy };

View File

@@ -0,0 +1,25 @@
/**
* 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[];
export { difference };

View File

@@ -0,0 +1,25 @@
/**
* 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[];
export { difference };

View File

@@ -0,0 +1,10 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function difference(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter(item => !secondSet.has(item));
}
exports.difference = difference;

View File

@@ -0,0 +1,6 @@
function difference(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter(item => !secondSet.has(item));
}
export { difference };

View File

@@ -0,0 +1,35 @@
/**
* 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[];
export { differenceBy };

View File

@@ -0,0 +1,35 @@
/**
* 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[];
export { differenceBy };

View File

@@ -0,0 +1,12 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function differenceBy(firstArr, secondArr, mapper) {
const mappedSecondSet = new Set(secondArr.map(item => mapper(item)));
return firstArr.filter(item => {
return !mappedSecondSet.has(mapper(item));
});
}
exports.differenceBy = differenceBy;

View File

@@ -0,0 +1,8 @@
function differenceBy(firstArr, secondArr, mapper) {
const mappedSecondSet = new Set(secondArr.map(item => mapper(item)));
return firstArr.filter(item => {
return !mappedSecondSet.has(mapper(item));
});
}
export { differenceBy };

View File

@@ -0,0 +1,31 @@
/**
* 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[];
export { differenceWith };

View File

@@ -0,0 +1,31 @@
/**
* 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[];
export { differenceWith };

View File

@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function differenceWith(firstArr, secondArr, areItemsEqual) {
return firstArr.filter(firstItem => {
return secondArr.every(secondItem => {
return !areItemsEqual(firstItem, secondItem);
});
});
}
exports.differenceWith = differenceWith;

View File

@@ -0,0 +1,9 @@
function differenceWith(firstArr, secondArr, areItemsEqual) {
return firstArr.filter(firstItem => {
return secondArr.every(secondItem => {
return !areItemsEqual(firstItem, secondItem);
});
});
}
export { differenceWith };

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

@@ -0,0 +1,19 @@
/**
* 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[];
export { drop };

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

@@ -0,0 +1,19 @@
/**
* 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[];
export { drop };

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

@@ -0,0 +1,10 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function drop(arr, itemsCount) {
itemsCount = Math.max(itemsCount, 0);
return arr.slice(itemsCount);
}
exports.drop = drop;

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

@@ -0,0 +1,6 @@
function drop(arr, itemsCount) {
itemsCount = Math.max(itemsCount, 0);
return arr.slice(itemsCount);
}
export { drop };

View File

@@ -0,0 +1,19 @@
/**
* 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[];
export { dropRight };

View File

@@ -0,0 +1,19 @@
/**
* 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[];
export { dropRight };

View File

@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function dropRight(arr, itemsCount) {
itemsCount = Math.min(-itemsCount, 0);
if (itemsCount === 0) {
return arr.slice();
}
return arr.slice(0, itemsCount);
}
exports.dropRight = dropRight;

View File

@@ -0,0 +1,9 @@
function dropRight(arr, itemsCount) {
itemsCount = Math.min(-itemsCount, 0);
if (itemsCount === 0) {
return arr.slice();
}
return arr.slice(0, itemsCount);
}
export { dropRight };

View File

@@ -0,0 +1,21 @@
/**
* 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[];
export { dropRightWhile };

View File

@@ -0,0 +1,21 @@
/**
* 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[];
export { dropRightWhile };

View File

@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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 [];
}
exports.dropRightWhile = dropRightWhile;

View File

@@ -0,0 +1,10 @@
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 [];
}
export { dropRightWhile };

View File

@@ -0,0 +1,21 @@
/**
* 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[];
export { dropWhile };

View File

@@ -0,0 +1,21 @@
/**
* 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[];
export { dropWhile };

View File

@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function dropWhile(arr, canContinueDropping) {
const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr));
if (dropEndIndex === -1) {
return [];
}
return arr.slice(dropEndIndex);
}
exports.dropWhile = dropWhile;

View File

@@ -0,0 +1,9 @@
function dropWhile(arr, canContinueDropping) {
const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr));
if (dropEndIndex === -1) {
return [];
}
return arr.slice(dropEndIndex);
}
export { dropWhile };

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

@@ -0,0 +1,88 @@
/**
* 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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
export { fill };

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

@@ -0,0 +1,88 @@
/**
* 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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -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
* const array = [1, 2, 3];
* const result = fill(array, 'a');
* // => ['a', 'a', 'a']
*
* const result = fill(Array(3), 2);
* // => [2, 2, 2]
*
* const result = fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*
* const result = fill(array, '*', -2, -1);
* // => [1, '*', 3]
*/
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
export { fill };

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

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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;
}
exports.fill = fill;

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

@@ -0,0 +1,11 @@
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;
}
export { fill };

View File

@@ -0,0 +1,35 @@
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[]>;
export { filterAsync };

View File

@@ -0,0 +1,35 @@
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[]>;
export { filterAsync };

View File

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const limitAsync = require('./limitAsync.js');
async function filterAsync(array, predicate, options) {
if (options?.concurrency != null) {
predicate = limitAsync.limitAsync(predicate, options.concurrency);
}
const results = await Promise.all(array.map(predicate));
return array.filter((_, index) => results[index]);
}
exports.filterAsync = filterAsync;

View File

@@ -0,0 +1,11 @@
import { limitAsync } from './limitAsync.mjs';
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]);
}
export { filterAsync };

View File

@@ -0,0 +1,23 @@
/**
* 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) => U} iteratee - The function that produces the new array elements.
* @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) => U, depth?: D): Array<FlatArray<U[], D>>;
export { flatMap };

View File

@@ -0,0 +1,23 @@
/**
* 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) => U} iteratee - The function that produces the new array elements.
* @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) => U, depth?: D): Array<FlatArray<U[], D>>;
export { flatMap };

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

@@ -0,0 +1,11 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const flatten = require('./flatten.js');
function flatMap(arr, iteratee, depth = 1) {
return flatten.flatten(arr.map(item => iteratee(item)), depth);
}
exports.flatMap = flatMap;

View File

@@ -0,0 +1,7 @@
import { flatten } from './flatten.mjs';
function flatMap(arr, iteratee, depth = 1) {
return flatten(arr.map(item => iteratee(item)), depth);
}
export { flatMap };

View File

@@ -0,0 +1,37 @@
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[]>;
export { flatMapAsync };

View File

@@ -0,0 +1,37 @@
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[]>;
export { flatMapAsync };

View File

@@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const flatten = require('./flatten.js');
const limitAsync = require('./limitAsync.js');
async function flatMapAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync.limitAsync(callback, options.concurrency);
}
const results = await Promise.all(array.map(callback));
return flatten.flatten(results);
}
exports.flatMapAsync = flatMapAsync;

View File

@@ -0,0 +1,12 @@
import { flatten } from './flatten.mjs';
import { limitAsync } from './limitAsync.mjs';
async function flatMapAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync(callback, options.concurrency);
}
const results = await Promise.all(array.map(callback));
return flatten(results);
}
export { flatMapAsync };

View File

@@ -0,0 +1,18 @@
import { ExtractNestedArrayType } from './flattenDeep.mjs';
/**
* 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) => U} iteratee - The function that produces the new array elements.
* @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) => U): Array<ExtractNestedArrayType<U>>;
export { flatMapDeep };

View File

@@ -0,0 +1,18 @@
import { ExtractNestedArrayType } from './flattenDeep.js';
/**
* 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) => U} iteratee - The function that produces the new array elements.
* @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) => U): Array<ExtractNestedArrayType<U>>;
export { flatMapDeep };

View File

@@ -0,0 +1,11 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const flattenDeep = require('./flattenDeep.js');
function flatMapDeep(arr, iteratee) {
return flattenDeep.flattenDeep(arr.map((item) => iteratee(item)));
}
exports.flatMapDeep = flatMapDeep;

View File

@@ -0,0 +1,7 @@
import { flattenDeep } from './flattenDeep.mjs';
function flatMapDeep(arr, iteratee) {
return flattenDeep(arr.map((item) => iteratee(item)));
}
export { flatMapDeep };

View File

@@ -0,0 +1,19 @@
/**
* 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>>;
export { flatten };

View File

@@ -0,0 +1,19 @@
/**
* 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>>;
export { flatten };

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

@@ -0,0 +1,23 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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;
}
exports.flatten = flatten;

View File

@@ -0,0 +1,19 @@
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;
}
export { flatten };

View File

@@ -0,0 +1,25 @@
/**
* 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>>;
export { type ExtractNestedArrayType, flattenDeep };

View File

@@ -0,0 +1,25 @@
/**
* 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>>;
export { type ExtractNestedArrayType, flattenDeep };

View File

@@ -0,0 +1,11 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const flatten = require('./flatten.js');
function flattenDeep(arr) {
return flatten.flatten(arr, Infinity);
}
exports.flattenDeep = flattenDeep;

View File

@@ -0,0 +1,7 @@
import { flatten } from './flatten.mjs';
function flattenDeep(arr) {
return flatten(arr, Infinity);
}
export { flattenDeep };

View File

@@ -0,0 +1,35 @@
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>;
export { forEachAsync };

View File

@@ -0,0 +1,35 @@
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>;
export { forEachAsync };

View File

@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const limitAsync = require('./limitAsync.js');
async function forEachAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync.limitAsync(callback, options.concurrency);
}
await Promise.all(array.map(callback));
}
exports.forEachAsync = forEachAsync;

View File

@@ -0,0 +1,10 @@
import { limitAsync } from './limitAsync.mjs';
async function forEachAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync(callback, options.concurrency);
}
await Promise.all(array.map(callback));
}
export { forEachAsync };

View File

@@ -0,0 +1,48 @@
/**
* 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;
export { forEachRight };

View File

@@ -0,0 +1,48 @@
/**
* 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;
export { forEachRight };

View File

@@ -0,0 +1,12 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function forEachRight(arr, callback) {
for (let i = arr.length - 1; i >= 0; i--) {
const element = arr[i];
callback(element, i, arr);
}
}
exports.forEachRight = forEachRight;

View File

@@ -0,0 +1,8 @@
function forEachRight(arr, callback) {
for (let i = arr.length - 1; i >= 0; i--) {
const element = arr[i];
callback(element, i, arr);
}
}
export { forEachRight };

View File

@@ -0,0 +1,35 @@
/**
* 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) => K} getKeyFromItem - A function that generates a key from an element.
* @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' }
* // ]
* // }
*/
declare function groupBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
export { groupBy };

View File

@@ -0,0 +1,35 @@
/**
* 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) => K} getKeyFromItem - A function that generates a key from an element.
* @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' }
* // ]
* // }
*/
declare function groupBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
export { groupBy };

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

@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function groupBy(arr, getKeyFromItem) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = getKeyFromItem(item);
if (!Object.hasOwn(result, key)) {
result[key] = [];
}
result[key].push(item);
}
return result;
}
exports.groupBy = groupBy;

View File

@@ -0,0 +1,14 @@
function groupBy(arr, getKeyFromItem) {
const result = {};
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const key = getKeyFromItem(item);
if (!Object.hasOwn(result, key)) {
result[key] = [];
}
result[key].push(item);
}
return result;
}
export { groupBy };

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

@@ -0,0 +1,34 @@
/**
* 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;
export { head };

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

@@ -0,0 +1,34 @@
/**
* 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;
export { head };

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

@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function head(arr) {
return arr[0];
}
exports.head = head;

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

@@ -0,0 +1,5 @@
function head(arr) {
return arr[0];
}
export { head };

View File

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

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

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

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

@@ -0,0 +1,139 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const at = require('./at.js');
const chunk = require('./chunk.js');
const compact = require('./compact.js');
const countBy = require('./countBy.js');
const difference = require('./difference.js');
const differenceBy = require('./differenceBy.js');
const differenceWith = require('./differenceWith.js');
const drop = require('./drop.js');
const dropRight = require('./dropRight.js');
const dropRightWhile = require('./dropRightWhile.js');
const dropWhile = require('./dropWhile.js');
const fill = require('./fill.js');
const filterAsync = require('./filterAsync.js');
const flatMap = require('./flatMap.js');
const flatMapAsync = require('./flatMapAsync.js');
const flatMapDeep = require('./flatMapDeep.js');
const flatten = require('./flatten.js');
const flattenDeep = require('./flattenDeep.js');
const forEachAsync = require('./forEachAsync.js');
const forEachRight = require('./forEachRight.js');
const groupBy = require('./groupBy.js');
const head = require('./head.js');
const initial = require('./initial.js');
const intersection = require('./intersection.js');
const intersectionBy = require('./intersectionBy.js');
const intersectionWith = require('./intersectionWith.js');
const isSubset = require('./isSubset.js');
const isSubsetWith = require('./isSubsetWith.js');
const keyBy = require('./keyBy.js');
const last = require('./last.js');
const limitAsync = require('./limitAsync.js');
const mapAsync = require('./mapAsync.js');
const maxBy = require('./maxBy.js');
const minBy = require('./minBy.js');
const orderBy = require('./orderBy.js');
const partition = require('./partition.js');
const pull = require('./pull.js');
const pullAt = require('./pullAt.js');
const reduceAsync = require('./reduceAsync.js');
const remove = require('./remove.js');
const sample = require('./sample.js');
const sampleSize = require('./sampleSize.js');
const shuffle = require('./shuffle.js');
const sortBy = require('./sortBy.js');
const tail = require('./tail.js');
const take = require('./take.js');
const takeRight = require('./takeRight.js');
const takeRightWhile = require('./takeRightWhile.js');
const takeWhile = require('./takeWhile.js');
const toFilled = require('./toFilled.js');
const union = require('./union.js');
const unionBy = require('./unionBy.js');
const unionWith = require('./unionWith.js');
const uniq = require('./uniq.js');
const uniqBy = require('./uniqBy.js');
const uniqWith = require('./uniqWith.js');
const unzip = require('./unzip.js');
const unzipWith = require('./unzipWith.js');
const windowed = require('./windowed.js');
const without = require('./without.js');
const xor = require('./xor.js');
const xorBy = require('./xorBy.js');
const xorWith = require('./xorWith.js');
const zip = require('./zip.js');
const zipObject = require('./zipObject.js');
const zipWith = require('./zipWith.js');
exports.at = at.at;
exports.chunk = chunk.chunk;
exports.compact = compact.compact;
exports.countBy = countBy.countBy;
exports.difference = difference.difference;
exports.differenceBy = differenceBy.differenceBy;
exports.differenceWith = differenceWith.differenceWith;
exports.drop = drop.drop;
exports.dropRight = dropRight.dropRight;
exports.dropRightWhile = dropRightWhile.dropRightWhile;
exports.dropWhile = dropWhile.dropWhile;
exports.fill = fill.fill;
exports.filterAsync = filterAsync.filterAsync;
exports.flatMap = flatMap.flatMap;
exports.flatMapAsync = flatMapAsync.flatMapAsync;
exports.flatMapDeep = flatMapDeep.flatMapDeep;
exports.flatten = flatten.flatten;
exports.flattenDeep = flattenDeep.flattenDeep;
exports.forEachAsync = forEachAsync.forEachAsync;
exports.forEachRight = forEachRight.forEachRight;
exports.groupBy = groupBy.groupBy;
exports.head = head.head;
exports.initial = initial.initial;
exports.intersection = intersection.intersection;
exports.intersectionBy = intersectionBy.intersectionBy;
exports.intersectionWith = intersectionWith.intersectionWith;
exports.isSubset = isSubset.isSubset;
exports.isSubsetWith = isSubsetWith.isSubsetWith;
exports.keyBy = keyBy.keyBy;
exports.last = last.last;
exports.limitAsync = limitAsync.limitAsync;
exports.mapAsync = mapAsync.mapAsync;
exports.maxBy = maxBy.maxBy;
exports.minBy = minBy.minBy;
exports.orderBy = orderBy.orderBy;
exports.partition = partition.partition;
exports.pull = pull.pull;
exports.pullAt = pullAt.pullAt;
exports.reduceAsync = reduceAsync.reduceAsync;
exports.remove = remove.remove;
exports.sample = sample.sample;
exports.sampleSize = sampleSize.sampleSize;
exports.shuffle = shuffle.shuffle;
exports.sortBy = sortBy.sortBy;
exports.tail = tail.tail;
exports.take = take.take;
exports.takeRight = takeRight.takeRight;
exports.takeRightWhile = takeRightWhile.takeRightWhile;
exports.takeWhile = takeWhile.takeWhile;
exports.toFilled = toFilled.toFilled;
exports.union = union.union;
exports.unionBy = unionBy.unionBy;
exports.unionWith = unionWith.unionWith;
exports.uniq = uniq.uniq;
exports.uniqBy = uniqBy.uniqBy;
exports.uniqWith = uniqWith.uniqWith;
exports.unzip = unzip.unzip;
exports.unzipWith = unzipWith.unzipWith;
exports.windowed = windowed.windowed;
exports.without = without.without;
exports.xor = xor.xor;
exports.xorBy = xorBy.xorBy;
exports.xorWith = xorWith.xorWith;
exports.zip = zip.zip;
exports.zipObject = zipObject.zipObject;
exports.zipWith = zipWith.zipWith;

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

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

View File

@@ -0,0 +1,54 @@
/**
* Returns an empty array when the input is a tuple containing exactly one element.
*
* @template T The type of the single element.
* @param {[T]} arr - A tuple containing exactly one element.
* @returns {[]} An empty array since there is only one element.
*
* @example
* const array = [100] as const;
* const result = initial(array);
* // result will be []
*/
declare function initial<T>(arr: readonly [T]): [];
/**
* Returns an empty array when the input array is empty.
*
* @returns {[]} Always returns an empty array for an empty input.
*
* @example
* const array = [] as const;
* const result = initial(array);
* // result will be []
*/
declare function initial(arr: readonly []): [];
/**
* Returns a new array containing all elements except the last one from a tuple with multiple elements.
*
* @template T The types of the initial elements.
* @template U The type of the last element in the tuple.
* @param {[...T[], U]} arr - A tuple with one or more elements.
* @returns {T[]} A new array containing all but the last element of the tuple.
*
* @example
* const array = ['apple', 'banana', 'cherry'] as const;
* const result = initial(array);
* // result will be ['apple', 'banana']
*/
declare function initial<T, U>(arr: readonly [...T[], U]): T[];
/**
* Returns a new array containing all elements except the last one from the input array.
* If the input array is empty or has only one element, the function returns an empty array.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The input array.
* @returns {T[]} A new array containing all but the last element of the input array.
*
* @example
* const arr = [1, 2, 3, 4];
* const result = initial(arr);
* // result will be [1, 2, 3]
*/
declare function initial<T>(arr: readonly T[]): T[];
export { initial };

View File

@@ -0,0 +1,54 @@
/**
* Returns an empty array when the input is a tuple containing exactly one element.
*
* @template T The type of the single element.
* @param {[T]} arr - A tuple containing exactly one element.
* @returns {[]} An empty array since there is only one element.
*
* @example
* const array = [100] as const;
* const result = initial(array);
* // result will be []
*/
declare function initial<T>(arr: readonly [T]): [];
/**
* Returns an empty array when the input array is empty.
*
* @returns {[]} Always returns an empty array for an empty input.
*
* @example
* const array = [] as const;
* const result = initial(array);
* // result will be []
*/
declare function initial(arr: readonly []): [];
/**
* Returns a new array containing all elements except the last one from a tuple with multiple elements.
*
* @template T The types of the initial elements.
* @template U The type of the last element in the tuple.
* @param {[...T[], U]} arr - A tuple with one or more elements.
* @returns {T[]} A new array containing all but the last element of the tuple.
*
* @example
* const array = ['apple', 'banana', 'cherry'] as const;
* const result = initial(array);
* // result will be ['apple', 'banana']
*/
declare function initial<T, U>(arr: readonly [...T[], U]): T[];
/**
* Returns a new array containing all elements except the last one from the input array.
* If the input array is empty or has only one element, the function returns an empty array.
*
* @template T The type of elements in the array.
* @param {T[]} arr - The input array.
* @returns {T[]} A new array containing all but the last element of the input array.
*
* @example
* const arr = [1, 2, 3, 4];
* const result = initial(arr);
* // result will be [1, 2, 3]
*/
declare function initial<T>(arr: readonly T[]): T[];
export { initial };

View File

@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function initial(arr) {
return arr.slice(0, -1);
}
exports.initial = initial;

View File

@@ -0,0 +1,5 @@
function initial(arr) {
return arr.slice(0, -1);
}
export { initial };

View File

@@ -0,0 +1,21 @@
/**
* Returns the intersection of two arrays.
*
* This function takes two arrays and returns a new array containing the elements that are
* present in both arrays. It effectively filters out any elements from the first array that
* are not found in the second array.
*
* @template T - The type of elements in the array.
* @param {T[]} firstArr - The first array to compare.
* @param {T[]} secondArr - The second array to compare.
* @returns {T[]} A new array containing the elements that are present in both arrays.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [3, 4, 5, 6, 7];
* const result = intersection(array1, array2);
* // result will be [3, 4, 5] since these elements are in both arrays.
*/
declare function intersection<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
export { intersection };

View File

@@ -0,0 +1,21 @@
/**
* Returns the intersection of two arrays.
*
* This function takes two arrays and returns a new array containing the elements that are
* present in both arrays. It effectively filters out any elements from the first array that
* are not found in the second array.
*
* @template T - The type of elements in the array.
* @param {T[]} firstArr - The first array to compare.
* @param {T[]} secondArr - The second array to compare.
* @returns {T[]} A new array containing the elements that are present in both arrays.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [3, 4, 5, 6, 7];
* const result = intersection(array1, array2);
* // result will be [3, 4, 5] since these elements are in both arrays.
*/
declare function intersection<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
export { intersection };

View File

@@ -0,0 +1,12 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function intersection(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter(item => {
return secondSet.has(item);
});
}
exports.intersection = intersection;

View File

@@ -0,0 +1,8 @@
function intersection(firstArr, secondArr) {
const secondSet = new Set(secondArr);
return firstArr.filter(item => {
return secondSet.has(item);
});
}
export { intersection };

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