Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- astra_scene_test/X_03/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.js +13 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.mjs +13 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.d.mts +19 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.d.ts +19 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.js +29 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.mjs +29 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.d.mts +75 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.d.ts +75 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.js +23 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.mjs +23 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.d.mts +27 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.d.ts +27 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.js +37 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.mjs +37 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.d.mts +32 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.d.ts +32 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.js +42 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.mjs +42 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.d.mts +35 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.d.ts +35 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.js +53 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.mjs +53 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.d.mts +16 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.d.ts +16 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.js +22 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.mjs +22 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.d.mts +37 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.d.ts +37 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.js +45 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.mjs +45 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.d.mts +26 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.d.ts +26 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.js +29 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.mjs +29 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.d.mts +36 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.d.ts +36 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.js +41 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.mjs +41 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.d.mts +32 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.d.ts +32 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.js +38 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.mjs +38 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.d.mts +20 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.d.ts +20 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.js +23 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.mjs +23 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.d.mts +20 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.d.ts +20 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.js +24 -0
- astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.mjs +24 -0
astra_scene_test/X_03/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region \0rolldown/runtime.js
|
| 2 |
+
var __defProp = Object.defineProperty;
|
| 3 |
+
var __exportAll = (all, no_symbols) => {
|
| 4 |
+
let target = {};
|
| 5 |
+
for (var name in all) __defProp(target, name, {
|
| 6 |
+
get: all[name],
|
| 7 |
+
enumerable: true
|
| 8 |
+
});
|
| 9 |
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
| 10 |
+
return target;
|
| 11 |
+
};
|
| 12 |
+
//#endregion
|
| 13 |
+
exports.__exportAll = __exportAll;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region \0rolldown/runtime.js
|
| 2 |
+
var __defProp = Object.defineProperty;
|
| 3 |
+
var __exportAll = (all, no_symbols) => {
|
| 4 |
+
let target = {};
|
| 5 |
+
for (var name in all) __defProp(target, name, {
|
| 6 |
+
get: all[name],
|
| 7 |
+
enumerable: true
|
| 8 |
+
});
|
| 9 |
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
| 10 |
+
return target;
|
| 11 |
+
};
|
| 12 |
+
//#endregion
|
| 13 |
+
export { __exportAll };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/at.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Retrieves elements from an array at the specified indices.
|
| 4 |
+
*
|
| 5 |
+
* This function supports negative indices, which count from the end of the array.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param arr - The array to retrieve elements from.
|
| 9 |
+
* @param indices - An array of indices specifying the positions of elements to retrieve.
|
| 10 |
+
* @returns A new array containing the elements at the specified indices.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const numbers = [10, 20, 30, 40, 50];
|
| 14 |
+
* const result = at(numbers, [1, 3, 4]);
|
| 15 |
+
* console.log(result); // [20, 40, 50]
|
| 16 |
+
*/
|
| 17 |
+
declare function at<T>(arr: readonly T[], indices: readonly number[]): T[];
|
| 18 |
+
//#endregion
|
| 19 |
+
export { at };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/at.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Retrieves elements from an array at the specified indices.
|
| 4 |
+
*
|
| 5 |
+
* This function supports negative indices, which count from the end of the array.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param arr - The array to retrieve elements from.
|
| 9 |
+
* @param indices - An array of indices specifying the positions of elements to retrieve.
|
| 10 |
+
* @returns A new array containing the elements at the specified indices.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const numbers = [10, 20, 30, 40, 50];
|
| 14 |
+
* const result = at(numbers, [1, 3, 4]);
|
| 15 |
+
* console.log(result); // [20, 40, 50]
|
| 16 |
+
*/
|
| 17 |
+
declare function at<T>(arr: readonly T[], indices: readonly number[]): T[];
|
| 18 |
+
//#endregion
|
| 19 |
+
export { at };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/at.ts
|
| 2 |
+
/**
|
| 3 |
+
* Retrieves elements from an array at the specified indices.
|
| 4 |
+
*
|
| 5 |
+
* This function supports negative indices, which count from the end of the array.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param arr - The array to retrieve elements from.
|
| 9 |
+
* @param indices - An array of indices specifying the positions of elements to retrieve.
|
| 10 |
+
* @returns A new array containing the elements at the specified indices.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const numbers = [10, 20, 30, 40, 50];
|
| 14 |
+
* const result = at(numbers, [1, 3, 4]);
|
| 15 |
+
* console.log(result); // [20, 40, 50]
|
| 16 |
+
*/
|
| 17 |
+
function at(arr, indices) {
|
| 18 |
+
const result = new Array(indices.length);
|
| 19 |
+
const length = arr.length;
|
| 20 |
+
for (let i = 0; i < indices.length; i++) {
|
| 21 |
+
let index = indices[i];
|
| 22 |
+
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
|
| 23 |
+
if (index < 0) index += length;
|
| 24 |
+
result[i] = arr[index];
|
| 25 |
+
}
|
| 26 |
+
return result;
|
| 27 |
+
}
|
| 28 |
+
//#endregion
|
| 29 |
+
exports.at = at;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/at.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/at.ts
|
| 2 |
+
/**
|
| 3 |
+
* Retrieves elements from an array at the specified indices.
|
| 4 |
+
*
|
| 5 |
+
* This function supports negative indices, which count from the end of the array.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param arr - The array to retrieve elements from.
|
| 9 |
+
* @param indices - An array of indices specifying the positions of elements to retrieve.
|
| 10 |
+
* @returns A new array containing the elements at the specified indices.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const numbers = [10, 20, 30, 40, 50];
|
| 14 |
+
* const result = at(numbers, [1, 3, 4]);
|
| 15 |
+
* console.log(result); // [20, 40, 50]
|
| 16 |
+
*/
|
| 17 |
+
function at(arr, indices) {
|
| 18 |
+
const result = new Array(indices.length);
|
| 19 |
+
const length = arr.length;
|
| 20 |
+
for (let i = 0; i < indices.length; i++) {
|
| 21 |
+
let index = indices[i];
|
| 22 |
+
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
|
| 23 |
+
if (index < 0) index += length;
|
| 24 |
+
result[i] = arr[index];
|
| 25 |
+
}
|
| 26 |
+
return result;
|
| 27 |
+
}
|
| 28 |
+
//#endregion
|
| 29 |
+
export { at };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.d.mts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/cartesianProduct.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 4 |
+
*
|
| 5 |
+
* @template T
|
| 6 |
+
* @param arr1 - The array to take the product of.
|
| 7 |
+
* @returns An array of single-element tuples.
|
| 8 |
+
*/
|
| 9 |
+
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
|
| 10 |
+
/**
|
| 11 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 12 |
+
*
|
| 13 |
+
* @template T, U
|
| 14 |
+
* @param arr1 - The first array to take the product of.
|
| 15 |
+
* @param arr2 - The second array to take the product of.
|
| 16 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* cartesianProduct([1, 2], ['a', 'b']);
|
| 20 |
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
| 21 |
+
*/
|
| 22 |
+
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
|
| 23 |
+
/**
|
| 24 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 25 |
+
*
|
| 26 |
+
* @template T, U, V
|
| 27 |
+
* @param arr1 - The first array to take the product of.
|
| 28 |
+
* @param arr2 - The second array to take the product of.
|
| 29 |
+
* @param arr3 - The third array to take the product of.
|
| 30 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 31 |
+
*/
|
| 32 |
+
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
|
| 33 |
+
/**
|
| 34 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 35 |
+
*
|
| 36 |
+
* @template T, U, V, W
|
| 37 |
+
* @param arr1 - The first array to take the product of.
|
| 38 |
+
* @param arr2 - The second array to take the product of.
|
| 39 |
+
* @param arr3 - The third array to take the product of.
|
| 40 |
+
* @param arr4 - The fourth array to take the product of.
|
| 41 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 42 |
+
*/
|
| 43 |
+
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
|
| 44 |
+
/**
|
| 45 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 46 |
+
*
|
| 47 |
+
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
|
| 48 |
+
* The rightmost array advances fastest, like the digits of an odometer.
|
| 49 |
+
*
|
| 50 |
+
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
|
| 51 |
+
* If any input array is empty, the result is `[]`.
|
| 52 |
+
*
|
| 53 |
+
* @template T
|
| 54 |
+
* @param arrs - The arrays to take the product of.
|
| 55 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 56 |
+
*
|
| 57 |
+
* @example
|
| 58 |
+
* cartesianProduct([1, 2], ['a', 'b']);
|
| 59 |
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
| 60 |
+
*
|
| 61 |
+
* @example
|
| 62 |
+
* cartesianProduct([0, 1], [0, 1], [0, 1]);
|
| 63 |
+
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
|
| 64 |
+
*
|
| 65 |
+
* @example
|
| 66 |
+
* cartesianProduct([1, 2, 3], []);
|
| 67 |
+
* // => []
|
| 68 |
+
*
|
| 69 |
+
* @example
|
| 70 |
+
* cartesianProduct();
|
| 71 |
+
* // => [[]]
|
| 72 |
+
*/
|
| 73 |
+
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
|
| 74 |
+
//#endregion
|
| 75 |
+
export { cartesianProduct };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/cartesianProduct.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 4 |
+
*
|
| 5 |
+
* @template T
|
| 6 |
+
* @param arr1 - The array to take the product of.
|
| 7 |
+
* @returns An array of single-element tuples.
|
| 8 |
+
*/
|
| 9 |
+
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
|
| 10 |
+
/**
|
| 11 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 12 |
+
*
|
| 13 |
+
* @template T, U
|
| 14 |
+
* @param arr1 - The first array to take the product of.
|
| 15 |
+
* @param arr2 - The second array to take the product of.
|
| 16 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* cartesianProduct([1, 2], ['a', 'b']);
|
| 20 |
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
| 21 |
+
*/
|
| 22 |
+
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
|
| 23 |
+
/**
|
| 24 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 25 |
+
*
|
| 26 |
+
* @template T, U, V
|
| 27 |
+
* @param arr1 - The first array to take the product of.
|
| 28 |
+
* @param arr2 - The second array to take the product of.
|
| 29 |
+
* @param arr3 - The third array to take the product of.
|
| 30 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 31 |
+
*/
|
| 32 |
+
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
|
| 33 |
+
/**
|
| 34 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 35 |
+
*
|
| 36 |
+
* @template T, U, V, W
|
| 37 |
+
* @param arr1 - The first array to take the product of.
|
| 38 |
+
* @param arr2 - The second array to take the product of.
|
| 39 |
+
* @param arr3 - The third array to take the product of.
|
| 40 |
+
* @param arr4 - The fourth array to take the product of.
|
| 41 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 42 |
+
*/
|
| 43 |
+
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
|
| 44 |
+
/**
|
| 45 |
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
| 46 |
+
*
|
| 47 |
+
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
|
| 48 |
+
* The rightmost array advances fastest, like the digits of an odometer.
|
| 49 |
+
*
|
| 50 |
+
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
|
| 51 |
+
* If any input array is empty, the result is `[]`.
|
| 52 |
+
*
|
| 53 |
+
* @template T
|
| 54 |
+
* @param arrs - The arrays to take the product of.
|
| 55 |
+
* @returns An array of tuples representing the Cartesian product.
|
| 56 |
+
*
|
| 57 |
+
* @example
|
| 58 |
+
* cartesianProduct([1, 2], ['a', 'b']);
|
| 59 |
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
| 60 |
+
*
|
| 61 |
+
* @example
|
| 62 |
+
* cartesianProduct([0, 1], [0, 1], [0, 1]);
|
| 63 |
+
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
|
| 64 |
+
*
|
| 65 |
+
* @example
|
| 66 |
+
* cartesianProduct([1, 2, 3], []);
|
| 67 |
+
* // => []
|
| 68 |
+
*
|
| 69 |
+
* @example
|
| 70 |
+
* cartesianProduct();
|
| 71 |
+
* // => [[]]
|
| 72 |
+
*/
|
| 73 |
+
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
|
| 74 |
+
//#endregion
|
| 75 |
+
export { cartesianProduct };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/cartesianProduct.ts
|
| 2 |
+
function cartesianProduct(...arrs) {
|
| 3 |
+
if (arrs.length === 0) return [[]];
|
| 4 |
+
let total = 1;
|
| 5 |
+
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
|
| 6 |
+
if (total === 0) return [];
|
| 7 |
+
const n = arrs.length;
|
| 8 |
+
const result = Array(total);
|
| 9 |
+
for (let i = 0; i < total; i++) {
|
| 10 |
+
const tuple = Array(n);
|
| 11 |
+
let idx = i;
|
| 12 |
+
for (let j = n - 1; j >= 0; j--) {
|
| 13 |
+
const arr = arrs[j];
|
| 14 |
+
const len = arr.length;
|
| 15 |
+
tuple[j] = arr[idx % len];
|
| 16 |
+
idx = Math.floor(idx / len);
|
| 17 |
+
}
|
| 18 |
+
result[i] = tuple;
|
| 19 |
+
}
|
| 20 |
+
return result;
|
| 21 |
+
}
|
| 22 |
+
//#endregion
|
| 23 |
+
exports.cartesianProduct = cartesianProduct;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/cartesianProduct.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/cartesianProduct.ts
|
| 2 |
+
function cartesianProduct(...arrs) {
|
| 3 |
+
if (arrs.length === 0) return [[]];
|
| 4 |
+
let total = 1;
|
| 5 |
+
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
|
| 6 |
+
if (total === 0) return [];
|
| 7 |
+
const n = arrs.length;
|
| 8 |
+
const result = Array(total);
|
| 9 |
+
for (let i = 0; i < total; i++) {
|
| 10 |
+
const tuple = Array(n);
|
| 11 |
+
let idx = i;
|
| 12 |
+
for (let j = n - 1; j >= 0; j--) {
|
| 13 |
+
const arr = arrs[j];
|
| 14 |
+
const len = arr.length;
|
| 15 |
+
tuple[j] = arr[idx % len];
|
| 16 |
+
idx = Math.floor(idx / len);
|
| 17 |
+
}
|
| 18 |
+
result[i] = tuple;
|
| 19 |
+
}
|
| 20 |
+
return result;
|
| 21 |
+
}
|
| 22 |
+
//#endregion
|
| 23 |
+
export { cartesianProduct };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunk.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into smaller arrays of a specified length.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an input array and divides it into multiple smaller arrays,
|
| 6 |
+
* each of a specified length. If the input array cannot be evenly divided,
|
| 7 |
+
* the final sub-array will contain the remaining elements.
|
| 8 |
+
*
|
| 9 |
+
* @template T The type of elements in the array.
|
| 10 |
+
* @param arr - The array to be chunked into smaller arrays.
|
| 11 |
+
* @param size - The size of each smaller array. Must be a positive integer.
|
| 12 |
+
* @returns A two-dimensional array where each sub-array has a maximum length of `size`.
|
| 13 |
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* // Splits an array of numbers into sub-arrays of length 2
|
| 17 |
+
* chunk([1, 2, 3, 4, 5], 2);
|
| 18 |
+
* // Returns: [[1, 2], [3, 4], [5]]
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Splits an array of strings into sub-arrays of length 3
|
| 22 |
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
| 23 |
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
| 24 |
+
*/
|
| 25 |
+
declare function chunk<T>(arr: readonly T[], size: number): T[][];
|
| 26 |
+
//#endregion
|
| 27 |
+
export { chunk };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunk.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into smaller arrays of a specified length.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an input array and divides it into multiple smaller arrays,
|
| 6 |
+
* each of a specified length. If the input array cannot be evenly divided,
|
| 7 |
+
* the final sub-array will contain the remaining elements.
|
| 8 |
+
*
|
| 9 |
+
* @template T The type of elements in the array.
|
| 10 |
+
* @param arr - The array to be chunked into smaller arrays.
|
| 11 |
+
* @param size - The size of each smaller array. Must be a positive integer.
|
| 12 |
+
* @returns A two-dimensional array where each sub-array has a maximum length of `size`.
|
| 13 |
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* // Splits an array of numbers into sub-arrays of length 2
|
| 17 |
+
* chunk([1, 2, 3, 4, 5], 2);
|
| 18 |
+
* // Returns: [[1, 2], [3, 4], [5]]
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Splits an array of strings into sub-arrays of length 3
|
| 22 |
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
| 23 |
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
| 24 |
+
*/
|
| 25 |
+
declare function chunk<T>(arr: readonly T[], size: number): T[][];
|
| 26 |
+
//#endregion
|
| 27 |
+
export { chunk };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunk.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into smaller arrays of a specified length.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an input array and divides it into multiple smaller arrays,
|
| 6 |
+
* each of a specified length. If the input array cannot be evenly divided,
|
| 7 |
+
* the final sub-array will contain the remaining elements.
|
| 8 |
+
*
|
| 9 |
+
* @template T The type of elements in the array.
|
| 10 |
+
* @param arr - The array to be chunked into smaller arrays.
|
| 11 |
+
* @param size - The size of each smaller array. Must be a positive integer.
|
| 12 |
+
* @returns A two-dimensional array where each sub-array has a maximum length of `size`.
|
| 13 |
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* // Splits an array of numbers into sub-arrays of length 2
|
| 17 |
+
* chunk([1, 2, 3, 4, 5], 2);
|
| 18 |
+
* // Returns: [[1, 2], [3, 4], [5]]
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Splits an array of strings into sub-arrays of length 3
|
| 22 |
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
| 23 |
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
| 24 |
+
*/
|
| 25 |
+
function chunk(arr, size) {
|
| 26 |
+
if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
|
| 27 |
+
const chunkLength = Math.ceil(arr.length / size);
|
| 28 |
+
const result = Array(chunkLength);
|
| 29 |
+
for (let index = 0; index < chunkLength; index++) {
|
| 30 |
+
const start = index * size;
|
| 31 |
+
const end = start + size;
|
| 32 |
+
result[index] = arr.slice(start, end);
|
| 33 |
+
}
|
| 34 |
+
return result;
|
| 35 |
+
}
|
| 36 |
+
//#endregion
|
| 37 |
+
exports.chunk = chunk;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunk.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunk.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into smaller arrays of a specified length.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an input array and divides it into multiple smaller arrays,
|
| 6 |
+
* each of a specified length. If the input array cannot be evenly divided,
|
| 7 |
+
* the final sub-array will contain the remaining elements.
|
| 8 |
+
*
|
| 9 |
+
* @template T The type of elements in the array.
|
| 10 |
+
* @param arr - The array to be chunked into smaller arrays.
|
| 11 |
+
* @param size - The size of each smaller array. Must be a positive integer.
|
| 12 |
+
* @returns A two-dimensional array where each sub-array has a maximum length of `size`.
|
| 13 |
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
| 14 |
+
*
|
| 15 |
+
* @example
|
| 16 |
+
* // Splits an array of numbers into sub-arrays of length 2
|
| 17 |
+
* chunk([1, 2, 3, 4, 5], 2);
|
| 18 |
+
* // Returns: [[1, 2], [3, 4], [5]]
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Splits an array of strings into sub-arrays of length 3
|
| 22 |
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
| 23 |
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
| 24 |
+
*/
|
| 25 |
+
function chunk(arr, size) {
|
| 26 |
+
if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
|
| 27 |
+
const chunkLength = Math.ceil(arr.length / size);
|
| 28 |
+
const result = Array(chunkLength);
|
| 29 |
+
for (let index = 0; index < chunkLength; index++) {
|
| 30 |
+
const start = index * size;
|
| 31 |
+
const end = start + size;
|
| 32 |
+
result[index] = arr.slice(start, end);
|
| 33 |
+
}
|
| 34 |
+
return result;
|
| 35 |
+
}
|
| 36 |
+
//#endregion
|
| 37 |
+
export { chunk };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunkBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into chunks of consecutive elements that share the same key.
|
| 4 |
+
*
|
| 5 |
+
* Walking left to right, each element's key is derived by `iteratee`. Whenever
|
| 6 |
+
* the key differs from the previous element's key, a new chunk is started;
|
| 7 |
+
* otherwise the element is appended to the current chunk. Keys are compared with
|
| 8 |
+
* `!==` (strict inequality), so equal primitives stay together while distinct
|
| 9 |
+
* object references always start a new chunk.
|
| 10 |
+
*
|
| 11 |
+
* Unlike {@link chunk}, which splits by a fixed size, `chunkBy` splits by a
|
| 12 |
+
* boundary condition, keeping runs of same-keyed elements together.
|
| 13 |
+
*
|
| 14 |
+
* @template T - The type of elements in the array.
|
| 15 |
+
* @param arr - The array to split into chunks.
|
| 16 |
+
* @param iteratee - A function that derives the comparison key for each element.
|
| 17 |
+
* @returns A two-dimensional array where each sub-array is a run of consecutive
|
| 18 |
+
* elements that produced the same key.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Group consecutive equal numbers
|
| 22 |
+
* chunkBy([1, 1, 2, 3, 3, 3], value => value);
|
| 23 |
+
* // Returns: [[1, 1], [2], [3, 3, 3]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* // Group consecutive words by their length
|
| 27 |
+
* chunkBy(['a', 'b', 'cd', 'ef', 'g'], word => word.length);
|
| 28 |
+
* // Returns: [['a', 'b'], ['cd', 'ef'], ['g']]
|
| 29 |
+
*/
|
| 30 |
+
declare function chunkBy<T>(arr: readonly T[], iteratee: (value: T) => unknown): T[][];
|
| 31 |
+
//#endregion
|
| 32 |
+
export { chunkBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunkBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into chunks of consecutive elements that share the same key.
|
| 4 |
+
*
|
| 5 |
+
* Walking left to right, each element's key is derived by `iteratee`. Whenever
|
| 6 |
+
* the key differs from the previous element's key, a new chunk is started;
|
| 7 |
+
* otherwise the element is appended to the current chunk. Keys are compared with
|
| 8 |
+
* `!==` (strict inequality), so equal primitives stay together while distinct
|
| 9 |
+
* object references always start a new chunk.
|
| 10 |
+
*
|
| 11 |
+
* Unlike {@link chunk}, which splits by a fixed size, `chunkBy` splits by a
|
| 12 |
+
* boundary condition, keeping runs of same-keyed elements together.
|
| 13 |
+
*
|
| 14 |
+
* @template T - The type of elements in the array.
|
| 15 |
+
* @param arr - The array to split into chunks.
|
| 16 |
+
* @param iteratee - A function that derives the comparison key for each element.
|
| 17 |
+
* @returns A two-dimensional array where each sub-array is a run of consecutive
|
| 18 |
+
* elements that produced the same key.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Group consecutive equal numbers
|
| 22 |
+
* chunkBy([1, 1, 2, 3, 3, 3], value => value);
|
| 23 |
+
* // Returns: [[1, 1], [2], [3, 3, 3]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* // Group consecutive words by their length
|
| 27 |
+
* chunkBy(['a', 'b', 'cd', 'ef', 'g'], word => word.length);
|
| 28 |
+
* // Returns: [['a', 'b'], ['cd', 'ef'], ['g']]
|
| 29 |
+
*/
|
| 30 |
+
declare function chunkBy<T>(arr: readonly T[], iteratee: (value: T) => unknown): T[][];
|
| 31 |
+
//#endregion
|
| 32 |
+
export { chunkBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunkBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into chunks of consecutive elements that share the same key.
|
| 4 |
+
*
|
| 5 |
+
* Walking left to right, each element's key is derived by `iteratee`. Whenever
|
| 6 |
+
* the key differs from the previous element's key, a new chunk is started;
|
| 7 |
+
* otherwise the element is appended to the current chunk. Keys are compared with
|
| 8 |
+
* `!==` (strict inequality), so equal primitives stay together while distinct
|
| 9 |
+
* object references always start a new chunk.
|
| 10 |
+
*
|
| 11 |
+
* Unlike {@link chunk}, which splits by a fixed size, `chunkBy` splits by a
|
| 12 |
+
* boundary condition, keeping runs of same-keyed elements together.
|
| 13 |
+
*
|
| 14 |
+
* @template T - The type of elements in the array.
|
| 15 |
+
* @param arr - The array to split into chunks.
|
| 16 |
+
* @param iteratee - A function that derives the comparison key for each element.
|
| 17 |
+
* @returns A two-dimensional array where each sub-array is a run of consecutive
|
| 18 |
+
* elements that produced the same key.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Group consecutive equal numbers
|
| 22 |
+
* chunkBy([1, 1, 2, 3, 3, 3], value => value);
|
| 23 |
+
* // Returns: [[1, 1], [2], [3, 3, 3]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* // Group consecutive words by their length
|
| 27 |
+
* chunkBy(['a', 'b', 'cd', 'ef', 'g'], word => word.length);
|
| 28 |
+
* // Returns: [['a', 'b'], ['cd', 'ef'], ['g']]
|
| 29 |
+
*/
|
| 30 |
+
function chunkBy(arr, iteratee) {
|
| 31 |
+
const result = [];
|
| 32 |
+
let prevKey;
|
| 33 |
+
for (let i = 0; i < arr.length; i++) {
|
| 34 |
+
const key = iteratee(arr[i]);
|
| 35 |
+
if (i === 0 || key !== prevKey) result.push([arr[i]]);
|
| 36 |
+
else result[result.length - 1].push(arr[i]);
|
| 37 |
+
prevKey = key;
|
| 38 |
+
}
|
| 39 |
+
return result;
|
| 40 |
+
}
|
| 41 |
+
//#endregion
|
| 42 |
+
exports.chunkBy = chunkBy;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/chunkBy.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/chunkBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Splits an array into chunks of consecutive elements that share the same key.
|
| 4 |
+
*
|
| 5 |
+
* Walking left to right, each element's key is derived by `iteratee`. Whenever
|
| 6 |
+
* the key differs from the previous element's key, a new chunk is started;
|
| 7 |
+
* otherwise the element is appended to the current chunk. Keys are compared with
|
| 8 |
+
* `!==` (strict inequality), so equal primitives stay together while distinct
|
| 9 |
+
* object references always start a new chunk.
|
| 10 |
+
*
|
| 11 |
+
* Unlike {@link chunk}, which splits by a fixed size, `chunkBy` splits by a
|
| 12 |
+
* boundary condition, keeping runs of same-keyed elements together.
|
| 13 |
+
*
|
| 14 |
+
* @template T - The type of elements in the array.
|
| 15 |
+
* @param arr - The array to split into chunks.
|
| 16 |
+
* @param iteratee - A function that derives the comparison key for each element.
|
| 17 |
+
* @returns A two-dimensional array where each sub-array is a run of consecutive
|
| 18 |
+
* elements that produced the same key.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* // Group consecutive equal numbers
|
| 22 |
+
* chunkBy([1, 1, 2, 3, 3, 3], value => value);
|
| 23 |
+
* // Returns: [[1, 1], [2], [3, 3, 3]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* // Group consecutive words by their length
|
| 27 |
+
* chunkBy(['a', 'b', 'cd', 'ef', 'g'], word => word.length);
|
| 28 |
+
* // Returns: [['a', 'b'], ['cd', 'ef'], ['g']]
|
| 29 |
+
*/
|
| 30 |
+
function chunkBy(arr, iteratee) {
|
| 31 |
+
const result = [];
|
| 32 |
+
let prevKey;
|
| 33 |
+
for (let i = 0; i < arr.length; i++) {
|
| 34 |
+
const key = iteratee(arr[i]);
|
| 35 |
+
if (i === 0 || key !== prevKey) result.push([arr[i]]);
|
| 36 |
+
else result[result.length - 1].push(arr[i]);
|
| 37 |
+
prevKey = key;
|
| 38 |
+
}
|
| 39 |
+
return result;
|
| 40 |
+
}
|
| 41 |
+
//#endregion
|
| 42 |
+
export { chunkBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.d.mts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/combinations.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Returns all `r`-length combinations of elements from the input array.
|
| 4 |
+
*
|
| 5 |
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
| 6 |
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
| 7 |
+
* combinations that look identical.
|
| 8 |
+
*
|
| 9 |
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
| 10 |
+
*
|
| 11 |
+
* @template T
|
| 12 |
+
* @param arr - The input array.
|
| 13 |
+
* @param r - The length of each combination. Must be a non-negative integer.
|
| 14 |
+
* @returns An array of `r`-length combinations.
|
| 15 |
+
* @throws {Error} If `r` is not a non-negative integer.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
| 19 |
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
| 20 |
+
*
|
| 21 |
+
* @example
|
| 22 |
+
* combinations([1, 2, 3, 4], 3);
|
| 23 |
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* combinations([1, 2, 3], 0);
|
| 27 |
+
* // => [[]]
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* combinations([1, 2], 5);
|
| 31 |
+
* // => []
|
| 32 |
+
*/
|
| 33 |
+
declare function combinations<T>(arr: readonly T[], r: number): T[][];
|
| 34 |
+
//#endregion
|
| 35 |
+
export { combinations };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/combinations.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Returns all `r`-length combinations of elements from the input array.
|
| 4 |
+
*
|
| 5 |
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
| 6 |
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
| 7 |
+
* combinations that look identical.
|
| 8 |
+
*
|
| 9 |
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
| 10 |
+
*
|
| 11 |
+
* @template T
|
| 12 |
+
* @param arr - The input array.
|
| 13 |
+
* @param r - The length of each combination. Must be a non-negative integer.
|
| 14 |
+
* @returns An array of `r`-length combinations.
|
| 15 |
+
* @throws {Error} If `r` is not a non-negative integer.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
| 19 |
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
| 20 |
+
*
|
| 21 |
+
* @example
|
| 22 |
+
* combinations([1, 2, 3, 4], 3);
|
| 23 |
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* combinations([1, 2, 3], 0);
|
| 27 |
+
* // => [[]]
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* combinations([1, 2], 5);
|
| 31 |
+
* // => []
|
| 32 |
+
*/
|
| 33 |
+
declare function combinations<T>(arr: readonly T[], r: number): T[][];
|
| 34 |
+
//#endregion
|
| 35 |
+
export { combinations };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/combinations.ts
|
| 2 |
+
/**
|
| 3 |
+
* Returns all `r`-length combinations of elements from the input array.
|
| 4 |
+
*
|
| 5 |
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
| 6 |
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
| 7 |
+
* combinations that look identical.
|
| 8 |
+
*
|
| 9 |
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
| 10 |
+
*
|
| 11 |
+
* @template T
|
| 12 |
+
* @param arr - The input array.
|
| 13 |
+
* @param r - The length of each combination. Must be a non-negative integer.
|
| 14 |
+
* @returns An array of `r`-length combinations.
|
| 15 |
+
* @throws {Error} If `r` is not a non-negative integer.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
| 19 |
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
| 20 |
+
*
|
| 21 |
+
* @example
|
| 22 |
+
* combinations([1, 2, 3, 4], 3);
|
| 23 |
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* combinations([1, 2, 3], 0);
|
| 27 |
+
* // => [[]]
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* combinations([1, 2], 5);
|
| 31 |
+
* // => []
|
| 32 |
+
*/
|
| 33 |
+
function combinations(arr, r) {
|
| 34 |
+
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
|
| 35 |
+
const n = arr.length;
|
| 36 |
+
if (r > n) return [];
|
| 37 |
+
if (r === 0) return [[]];
|
| 38 |
+
const indices = Array(r);
|
| 39 |
+
for (let i = 0; i < r; i++) indices[i] = i;
|
| 40 |
+
const result = [];
|
| 41 |
+
while (true) {
|
| 42 |
+
const tuple = Array(r);
|
| 43 |
+
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
|
| 44 |
+
result.push(tuple);
|
| 45 |
+
let i = r - 1;
|
| 46 |
+
while (i >= 0 && indices[i] === i + n - r) i--;
|
| 47 |
+
if (i < 0) return result;
|
| 48 |
+
indices[i]++;
|
| 49 |
+
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
//#endregion
|
| 53 |
+
exports.combinations = combinations;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/combinations.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/combinations.ts
|
| 2 |
+
/**
|
| 3 |
+
* Returns all `r`-length combinations of elements from the input array.
|
| 4 |
+
*
|
| 5 |
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
| 6 |
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
| 7 |
+
* combinations that look identical.
|
| 8 |
+
*
|
| 9 |
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
| 10 |
+
*
|
| 11 |
+
* @template T
|
| 12 |
+
* @param arr - The input array.
|
| 13 |
+
* @param r - The length of each combination. Must be a non-negative integer.
|
| 14 |
+
* @returns An array of `r`-length combinations.
|
| 15 |
+
* @throws {Error} If `r` is not a non-negative integer.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
| 19 |
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
| 20 |
+
*
|
| 21 |
+
* @example
|
| 22 |
+
* combinations([1, 2, 3, 4], 3);
|
| 23 |
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* combinations([1, 2, 3], 0);
|
| 27 |
+
* // => [[]]
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* combinations([1, 2], 5);
|
| 31 |
+
* // => []
|
| 32 |
+
*/
|
| 33 |
+
function combinations(arr, r) {
|
| 34 |
+
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
|
| 35 |
+
const n = arr.length;
|
| 36 |
+
if (r > n) return [];
|
| 37 |
+
if (r === 0) return [[]];
|
| 38 |
+
const indices = Array(r);
|
| 39 |
+
for (let i = 0; i < r; i++) indices[i] = i;
|
| 40 |
+
const result = [];
|
| 41 |
+
while (true) {
|
| 42 |
+
const tuple = Array(r);
|
| 43 |
+
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
|
| 44 |
+
result.push(tuple);
|
| 45 |
+
let i = r - 1;
|
| 46 |
+
while (i >= 0 && indices[i] === i + n - r) i--;
|
| 47 |
+
if (i < 0) return result;
|
| 48 |
+
indices[i]++;
|
| 49 |
+
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
//#endregion
|
| 53 |
+
export { combinations };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/compact.d.ts
|
| 2 |
+
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
|
| 3 |
+
/**
|
| 4 |
+
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of elements in the array.
|
| 7 |
+
* @param arr - The input array to remove falsey values.
|
| 8 |
+
* @returns A new array with all falsey values removed.
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
| 12 |
+
* Returns: [1, 2, 3, 4, 5]
|
| 13 |
+
*/
|
| 14 |
+
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
|
| 15 |
+
//#endregion
|
| 16 |
+
export { compact };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/compact.d.ts
|
| 2 |
+
type NotFalsey<T> = Exclude<T, false | null | 0 | 0n | '' | undefined>;
|
| 3 |
+
/**
|
| 4 |
+
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of elements in the array.
|
| 7 |
+
* @param arr - The input array to remove falsey values.
|
| 8 |
+
* @returns A new array with all falsey values removed.
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
| 12 |
+
* Returns: [1, 2, 3, 4, 5]
|
| 13 |
+
*/
|
| 14 |
+
declare function compact<T>(arr: readonly T[]): Array<NotFalsey<T>>;
|
| 15 |
+
//#endregion
|
| 16 |
+
export { compact };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/compact.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
|
| 4 |
+
*
|
| 5 |
+
* @template T - The type of elements in the array.
|
| 6 |
+
* @param arr - The input array to remove falsey values.
|
| 7 |
+
* @returns A new array with all falsey values removed.
|
| 8 |
+
*
|
| 9 |
+
* @example
|
| 10 |
+
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
| 11 |
+
* Returns: [1, 2, 3, 4, 5]
|
| 12 |
+
*/
|
| 13 |
+
function compact(arr) {
|
| 14 |
+
const result = [];
|
| 15 |
+
for (let i = 0; i < arr.length; i++) {
|
| 16 |
+
const item = arr[i];
|
| 17 |
+
if (item) result.push(item);
|
| 18 |
+
}
|
| 19 |
+
return result;
|
| 20 |
+
}
|
| 21 |
+
//#endregion
|
| 22 |
+
exports.compact = compact;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/compact.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/compact.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array.
|
| 4 |
+
*
|
| 5 |
+
* @template T - The type of elements in the array.
|
| 6 |
+
* @param arr - The input array to remove falsey values.
|
| 7 |
+
* @returns A new array with all falsey values removed.
|
| 8 |
+
*
|
| 9 |
+
* @example
|
| 10 |
+
* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]);
|
| 11 |
+
* Returns: [1, 2, 3, 4, 5]
|
| 12 |
+
*/
|
| 13 |
+
function compact(arr) {
|
| 14 |
+
const result = [];
|
| 15 |
+
for (let i = 0; i < arr.length; i++) {
|
| 16 |
+
const item = arr[i];
|
| 17 |
+
if (item) result.push(item);
|
| 18 |
+
}
|
| 19 |
+
return result;
|
| 20 |
+
}
|
| 21 |
+
//#endregion
|
| 22 |
+
export { compact };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/countBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Count the occurrences of each item in an array
|
| 4 |
+
* based on a transformation function.
|
| 5 |
+
*
|
| 6 |
+
* This function takes an array and a transformation function
|
| 7 |
+
* that converts each item in the array to a key. It then
|
| 8 |
+
* counts the occurrences of each transformed item and returns
|
| 9 |
+
* an object with the transformed items as keys and the counts
|
| 10 |
+
* as values.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of the items in the input array.
|
| 13 |
+
* @template K - The type of keys.
|
| 14 |
+
* @param arr - The input array to count occurrences.
|
| 15 |
+
* @param mapper - The transformation function that maps each item, its index, and the array to a key.
|
| 16 |
+
* @returns An object containing the transformed items as keys and the
|
| 17 |
+
* counts as values.
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
|
| 21 |
+
* const result = countBy(array, x => x);
|
| 22 |
+
* // result will be { a: 3, b: 2, c: 1 }
|
| 23 |
+
*
|
| 24 |
+
* @example
|
| 25 |
+
* const array = [1, 2, 3, 4, 5];
|
| 26 |
+
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
|
| 27 |
+
* // result will be { odd: 3, even: 2 }
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* // Using index parameter
|
| 31 |
+
* const array = ['a', 'b', 'c', 'd'];
|
| 32 |
+
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
|
| 33 |
+
* // result will be { first: 2, rest: 2 }
|
| 34 |
+
*/
|
| 35 |
+
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record<K, number>;
|
| 36 |
+
//#endregion
|
| 37 |
+
export { countBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/countBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Count the occurrences of each item in an array
|
| 4 |
+
* based on a transformation function.
|
| 5 |
+
*
|
| 6 |
+
* This function takes an array and a transformation function
|
| 7 |
+
* that converts each item in the array to a key. It then
|
| 8 |
+
* counts the occurrences of each transformed item and returns
|
| 9 |
+
* an object with the transformed items as keys and the counts
|
| 10 |
+
* as values.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of the items in the input array.
|
| 13 |
+
* @template K - The type of keys.
|
| 14 |
+
* @param arr - The input array to count occurrences.
|
| 15 |
+
* @param mapper - The transformation function that maps each item, its index, and the array to a key.
|
| 16 |
+
* @returns An object containing the transformed items as keys and the
|
| 17 |
+
* counts as values.
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
|
| 21 |
+
* const result = countBy(array, x => x);
|
| 22 |
+
* // result will be { a: 3, b: 2, c: 1 }
|
| 23 |
+
*
|
| 24 |
+
* @example
|
| 25 |
+
* const array = [1, 2, 3, 4, 5];
|
| 26 |
+
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
|
| 27 |
+
* // result will be { odd: 3, even: 2 }
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* // Using index parameter
|
| 31 |
+
* const array = ['a', 'b', 'c', 'd'];
|
| 32 |
+
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
|
| 33 |
+
* // result will be { first: 2, rest: 2 }
|
| 34 |
+
*/
|
| 35 |
+
declare function countBy<T, K extends PropertyKey>(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record<K, number>;
|
| 36 |
+
//#endregion
|
| 37 |
+
export { countBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/countBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Count the occurrences of each item in an array
|
| 4 |
+
* based on a transformation function.
|
| 5 |
+
*
|
| 6 |
+
* This function takes an array and a transformation function
|
| 7 |
+
* that converts each item in the array to a key. It then
|
| 8 |
+
* counts the occurrences of each transformed item and returns
|
| 9 |
+
* an object with the transformed items as keys and the counts
|
| 10 |
+
* as values.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of the items in the input array.
|
| 13 |
+
* @template K - The type of keys.
|
| 14 |
+
* @param arr - The input array to count occurrences.
|
| 15 |
+
* @param mapper - The transformation function that maps each item, its index, and the array to a key.
|
| 16 |
+
* @returns An object containing the transformed items as keys and the
|
| 17 |
+
* counts as values.
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
|
| 21 |
+
* const result = countBy(array, x => x);
|
| 22 |
+
* // result will be { a: 3, b: 2, c: 1 }
|
| 23 |
+
*
|
| 24 |
+
* @example
|
| 25 |
+
* const array = [1, 2, 3, 4, 5];
|
| 26 |
+
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
|
| 27 |
+
* // result will be { odd: 3, even: 2 }
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* // Using index parameter
|
| 31 |
+
* const array = ['a', 'b', 'c', 'd'];
|
| 32 |
+
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
|
| 33 |
+
* // result will be { first: 2, rest: 2 }
|
| 34 |
+
*/
|
| 35 |
+
function countBy(arr, mapper) {
|
| 36 |
+
const result = {};
|
| 37 |
+
for (let i = 0; i < arr.length; i++) {
|
| 38 |
+
const item = arr[i];
|
| 39 |
+
const key = mapper(item, i, arr);
|
| 40 |
+
result[key] = (result[key] ?? 0) + 1;
|
| 41 |
+
}
|
| 42 |
+
return result;
|
| 43 |
+
}
|
| 44 |
+
//#endregion
|
| 45 |
+
exports.countBy = countBy;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/countBy.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/countBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Count the occurrences of each item in an array
|
| 4 |
+
* based on a transformation function.
|
| 5 |
+
*
|
| 6 |
+
* This function takes an array and a transformation function
|
| 7 |
+
* that converts each item in the array to a key. It then
|
| 8 |
+
* counts the occurrences of each transformed item and returns
|
| 9 |
+
* an object with the transformed items as keys and the counts
|
| 10 |
+
* as values.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of the items in the input array.
|
| 13 |
+
* @template K - The type of keys.
|
| 14 |
+
* @param arr - The input array to count occurrences.
|
| 15 |
+
* @param mapper - The transformation function that maps each item, its index, and the array to a key.
|
| 16 |
+
* @returns An object containing the transformed items as keys and the
|
| 17 |
+
* counts as values.
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* const array = ['a', 'b', 'c', 'a', 'b', 'a'];
|
| 21 |
+
* const result = countBy(array, x => x);
|
| 22 |
+
* // result will be { a: 3, b: 2, c: 1 }
|
| 23 |
+
*
|
| 24 |
+
* @example
|
| 25 |
+
* const array = [1, 2, 3, 4, 5];
|
| 26 |
+
* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd');
|
| 27 |
+
* // result will be { odd: 3, even: 2 }
|
| 28 |
+
*
|
| 29 |
+
* @example
|
| 30 |
+
* // Using index parameter
|
| 31 |
+
* const array = ['a', 'b', 'c', 'd'];
|
| 32 |
+
* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest');
|
| 33 |
+
* // result will be { first: 2, rest: 2 }
|
| 34 |
+
*/
|
| 35 |
+
function countBy(arr, mapper) {
|
| 36 |
+
const result = {};
|
| 37 |
+
for (let i = 0; i < arr.length; i++) {
|
| 38 |
+
const item = arr[i];
|
| 39 |
+
const key = mapper(item, i, arr);
|
| 40 |
+
result[key] = (result[key] ?? 0) + 1;
|
| 41 |
+
}
|
| 42 |
+
return result;
|
| 43 |
+
}
|
| 44 |
+
//#endregion
|
| 45 |
+
export { countBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/difference.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array. It effectively
|
| 7 |
+
* filters out any elements from the first array that also appear in the second array.
|
| 8 |
+
*
|
| 9 |
+
* @template T
|
| 10 |
+
* @param firstArr - The array from which to derive the difference. This is the primary array
|
| 11 |
+
* from which elements will be compared and filtered.
|
| 12 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 13 |
+
* Each element in this array will be checked against the first array, and if a match is found,
|
| 14 |
+
* that element will be excluded from the result.
|
| 15 |
+
* @returns A new array containing the elements that are present in the first array but not
|
| 16 |
+
* in the second array.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* const array1 = [1, 2, 3, 4, 5];
|
| 20 |
+
* const array2 = [2, 4];
|
| 21 |
+
* const result = difference(array1, array2);
|
| 22 |
+
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
|
| 23 |
+
*/
|
| 24 |
+
declare function difference<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
|
| 25 |
+
//#endregion
|
| 26 |
+
export { difference };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/difference.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array. It effectively
|
| 7 |
+
* filters out any elements from the first array that also appear in the second array.
|
| 8 |
+
*
|
| 9 |
+
* @template T
|
| 10 |
+
* @param firstArr - The array from which to derive the difference. This is the primary array
|
| 11 |
+
* from which elements will be compared and filtered.
|
| 12 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 13 |
+
* Each element in this array will be checked against the first array, and if a match is found,
|
| 14 |
+
* that element will be excluded from the result.
|
| 15 |
+
* @returns A new array containing the elements that are present in the first array but not
|
| 16 |
+
* in the second array.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* const array1 = [1, 2, 3, 4, 5];
|
| 20 |
+
* const array2 = [2, 4];
|
| 21 |
+
* const result = difference(array1, array2);
|
| 22 |
+
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
|
| 23 |
+
*/
|
| 24 |
+
declare function difference<T>(firstArr: readonly T[], secondArr: readonly T[]): T[];
|
| 25 |
+
//#endregion
|
| 26 |
+
export { difference };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/difference.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array. It effectively
|
| 7 |
+
* filters out any elements from the first array that also appear in the second array.
|
| 8 |
+
*
|
| 9 |
+
* @template T
|
| 10 |
+
* @param firstArr - The array from which to derive the difference. This is the primary array
|
| 11 |
+
* from which elements will be compared and filtered.
|
| 12 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 13 |
+
* Each element in this array will be checked against the first array, and if a match is found,
|
| 14 |
+
* that element will be excluded from the result.
|
| 15 |
+
* @returns A new array containing the elements that are present in the first array but not
|
| 16 |
+
* in the second array.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* const array1 = [1, 2, 3, 4, 5];
|
| 20 |
+
* const array2 = [2, 4];
|
| 21 |
+
* const result = difference(array1, array2);
|
| 22 |
+
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
|
| 23 |
+
*/
|
| 24 |
+
function difference(firstArr, secondArr) {
|
| 25 |
+
const secondSet = new Set(secondArr);
|
| 26 |
+
return firstArr.filter((item) => !secondSet.has(item));
|
| 27 |
+
}
|
| 28 |
+
//#endregion
|
| 29 |
+
exports.difference = difference;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/difference.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/difference.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array. It effectively
|
| 7 |
+
* filters out any elements from the first array that also appear in the second array.
|
| 8 |
+
*
|
| 9 |
+
* @template T
|
| 10 |
+
* @param firstArr - The array from which to derive the difference. This is the primary array
|
| 11 |
+
* from which elements will be compared and filtered.
|
| 12 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 13 |
+
* Each element in this array will be checked against the first array, and if a match is found,
|
| 14 |
+
* that element will be excluded from the result.
|
| 15 |
+
* @returns A new array containing the elements that are present in the first array but not
|
| 16 |
+
* in the second array.
|
| 17 |
+
*
|
| 18 |
+
* @example
|
| 19 |
+
* const array1 = [1, 2, 3, 4, 5];
|
| 20 |
+
* const array2 = [2, 4];
|
| 21 |
+
* const result = difference(array1, array2);
|
| 22 |
+
* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.
|
| 23 |
+
*/
|
| 24 |
+
function difference(firstArr, secondArr) {
|
| 25 |
+
const secondSet = new Set(secondArr);
|
| 26 |
+
return firstArr.filter((item) => !secondSet.has(item));
|
| 27 |
+
}
|
| 28 |
+
//#endregion
|
| 29 |
+
export { difference };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.d.mts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays after mapping their elements through a provided function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a mapper function. It returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array, based on the identity calculated
|
| 7 |
+
* by the mapper function.
|
| 8 |
+
*
|
| 9 |
+
* Essentially, it filters out any elements from the first array that, when
|
| 10 |
+
* mapped, match an element in the mapped version of the second array.
|
| 11 |
+
*
|
| 12 |
+
* @template T, U
|
| 13 |
+
* @param firstArr - The primary array from which to derive the difference.
|
| 14 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 15 |
+
* @param mapper - The function to map the elements of both arrays. This function
|
| 16 |
+
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
|
| 17 |
+
* @returns A new array containing the elements from the first array that do not have a corresponding
|
| 18 |
+
* mapped identity in the second array.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 22 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 23 |
+
* const mapper = item => item.id;
|
| 24 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 25 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
|
| 26 |
+
*
|
| 27 |
+
* @example
|
| 28 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 29 |
+
* const array2 = [2, 4];
|
| 30 |
+
* const mapper = item => (typeof item === 'object' ? item.id : item);
|
| 31 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 32 |
+
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
|
| 33 |
+
*/
|
| 34 |
+
declare function differenceBy<T, U>(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[];
|
| 35 |
+
//#endregion
|
| 36 |
+
export { differenceBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceBy.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays after mapping their elements through a provided function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a mapper function. It returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array, based on the identity calculated
|
| 7 |
+
* by the mapper function.
|
| 8 |
+
*
|
| 9 |
+
* Essentially, it filters out any elements from the first array that, when
|
| 10 |
+
* mapped, match an element in the mapped version of the second array.
|
| 11 |
+
*
|
| 12 |
+
* @template T, U
|
| 13 |
+
* @param firstArr - The primary array from which to derive the difference.
|
| 14 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 15 |
+
* @param mapper - The function to map the elements of both arrays. This function
|
| 16 |
+
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
|
| 17 |
+
* @returns A new array containing the elements from the first array that do not have a corresponding
|
| 18 |
+
* mapped identity in the second array.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 22 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 23 |
+
* const mapper = item => item.id;
|
| 24 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 25 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
|
| 26 |
+
*
|
| 27 |
+
* @example
|
| 28 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 29 |
+
* const array2 = [2, 4];
|
| 30 |
+
* const mapper = item => (typeof item === 'object' ? item.id : item);
|
| 31 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 32 |
+
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
|
| 33 |
+
*/
|
| 34 |
+
declare function differenceBy<T, U>(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[];
|
| 35 |
+
//#endregion
|
| 36 |
+
export { differenceBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays after mapping their elements through a provided function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a mapper function. It returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array, based on the identity calculated
|
| 7 |
+
* by the mapper function.
|
| 8 |
+
*
|
| 9 |
+
* Essentially, it filters out any elements from the first array that, when
|
| 10 |
+
* mapped, match an element in the mapped version of the second array.
|
| 11 |
+
*
|
| 12 |
+
* @template T, U
|
| 13 |
+
* @param firstArr - The primary array from which to derive the difference.
|
| 14 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 15 |
+
* @param mapper - The function to map the elements of both arrays. This function
|
| 16 |
+
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
|
| 17 |
+
* @returns A new array containing the elements from the first array that do not have a corresponding
|
| 18 |
+
* mapped identity in the second array.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 22 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 23 |
+
* const mapper = item => item.id;
|
| 24 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 25 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
|
| 26 |
+
*
|
| 27 |
+
* @example
|
| 28 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 29 |
+
* const array2 = [2, 4];
|
| 30 |
+
* const mapper = item => (typeof item === 'object' ? item.id : item);
|
| 31 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 32 |
+
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
|
| 33 |
+
*/
|
| 34 |
+
function differenceBy(firstArr, secondArr, mapper) {
|
| 35 |
+
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
|
| 36 |
+
return firstArr.filter((item) => {
|
| 37 |
+
return !mappedSecondSet.has(mapper(item));
|
| 38 |
+
});
|
| 39 |
+
}
|
| 40 |
+
//#endregion
|
| 41 |
+
exports.differenceBy = differenceBy;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceBy.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceBy.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays after mapping their elements through a provided function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a mapper function. It returns a new array containing the elements
|
| 6 |
+
* that are present in the first array but not in the second array, based on the identity calculated
|
| 7 |
+
* by the mapper function.
|
| 8 |
+
*
|
| 9 |
+
* Essentially, it filters out any elements from the first array that, when
|
| 10 |
+
* mapped, match an element in the mapped version of the second array.
|
| 11 |
+
*
|
| 12 |
+
* @template T, U
|
| 13 |
+
* @param firstArr - The primary array from which to derive the difference.
|
| 14 |
+
* @param secondArr - The array containing elements to be excluded from the first array.
|
| 15 |
+
* @param mapper - The function to map the elements of both arrays. This function
|
| 16 |
+
* is applied to each element in both arrays, and the comparison is made based on the mapped values.
|
| 17 |
+
* @returns A new array containing the elements from the first array that do not have a corresponding
|
| 18 |
+
* mapped identity in the second array.
|
| 19 |
+
*
|
| 20 |
+
* @example
|
| 21 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 22 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 23 |
+
* const mapper = item => item.id;
|
| 24 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 25 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
|
| 26 |
+
*
|
| 27 |
+
* @example
|
| 28 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 29 |
+
* const array2 = [2, 4];
|
| 30 |
+
* const mapper = item => (typeof item === 'object' ? item.id : item);
|
| 31 |
+
* const result = differenceBy(array1, array2, mapper);
|
| 32 |
+
* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
|
| 33 |
+
*/
|
| 34 |
+
function differenceBy(firstArr, secondArr, mapper) {
|
| 35 |
+
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
|
| 36 |
+
return firstArr.filter((item) => {
|
| 37 |
+
return !mappedSecondSet.has(mapper(item));
|
| 38 |
+
});
|
| 39 |
+
}
|
| 40 |
+
//#endregion
|
| 41 |
+
export { differenceBy };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceWith.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays based on a custom equality function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a custom comparison function. It returns a new array containing
|
| 6 |
+
* the elements that are present in the first array but not in the second array. The comparison to determine
|
| 7 |
+
* if elements are equal is made using the provided custom function.
|
| 8 |
+
*
|
| 9 |
+
* @template T, U
|
| 10 |
+
* @param firstArr - The array from which to get the difference.
|
| 11 |
+
* @param secondArr - The array containing elements to exclude from the first array.
|
| 12 |
+
* @param areItemsEqual - A function to determine if two items are equal.
|
| 13 |
+
* @returns A new array containing the elements from the first array that do not match any elements in the second array
|
| 14 |
+
* according to the custom equality function.
|
| 15 |
+
*
|
| 16 |
+
* @example
|
| 17 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 18 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 19 |
+
* const areItemsEqual = (a, b) => a.id === b.id;
|
| 20 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 21 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
|
| 22 |
+
*
|
| 23 |
+
* @example
|
| 24 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 25 |
+
* const array2 = [2, 4];
|
| 26 |
+
* const areItemsEqual = (a, b) => a.id === b;
|
| 27 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 28 |
+
* // 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.
|
| 29 |
+
*/
|
| 30 |
+
declare function differenceWith<T, U>(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[];
|
| 31 |
+
//#endregion
|
| 32 |
+
export { differenceWith };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceWith.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays based on a custom equality function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a custom comparison function. It returns a new array containing
|
| 6 |
+
* the elements that are present in the first array but not in the second array. The comparison to determine
|
| 7 |
+
* if elements are equal is made using the provided custom function.
|
| 8 |
+
*
|
| 9 |
+
* @template T, U
|
| 10 |
+
* @param firstArr - The array from which to get the difference.
|
| 11 |
+
* @param secondArr - The array containing elements to exclude from the first array.
|
| 12 |
+
* @param areItemsEqual - A function to determine if two items are equal.
|
| 13 |
+
* @returns A new array containing the elements from the first array that do not match any elements in the second array
|
| 14 |
+
* according to the custom equality function.
|
| 15 |
+
*
|
| 16 |
+
* @example
|
| 17 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 18 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 19 |
+
* const areItemsEqual = (a, b) => a.id === b.id;
|
| 20 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 21 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
|
| 22 |
+
*
|
| 23 |
+
* @example
|
| 24 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 25 |
+
* const array2 = [2, 4];
|
| 26 |
+
* const areItemsEqual = (a, b) => a.id === b;
|
| 27 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 28 |
+
* // 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.
|
| 29 |
+
*/
|
| 30 |
+
declare function differenceWith<T, U>(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[];
|
| 31 |
+
//#endregion
|
| 32 |
+
export { differenceWith };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceWith.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays based on a custom equality function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a custom comparison function. It returns a new array containing
|
| 6 |
+
* the elements that are present in the first array but not in the second array. The comparison to determine
|
| 7 |
+
* if elements are equal is made using the provided custom function.
|
| 8 |
+
*
|
| 9 |
+
* @template T, U
|
| 10 |
+
* @param firstArr - The array from which to get the difference.
|
| 11 |
+
* @param secondArr - The array containing elements to exclude from the first array.
|
| 12 |
+
* @param areItemsEqual - A function to determine if two items are equal.
|
| 13 |
+
* @returns A new array containing the elements from the first array that do not match any elements in the second array
|
| 14 |
+
* according to the custom equality function.
|
| 15 |
+
*
|
| 16 |
+
* @example
|
| 17 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 18 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 19 |
+
* const areItemsEqual = (a, b) => a.id === b.id;
|
| 20 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 21 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
|
| 22 |
+
*
|
| 23 |
+
* @example
|
| 24 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 25 |
+
* const array2 = [2, 4];
|
| 26 |
+
* const areItemsEqual = (a, b) => a.id === b;
|
| 27 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 28 |
+
* // 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.
|
| 29 |
+
*/
|
| 30 |
+
function differenceWith(firstArr, secondArr, areItemsEqual) {
|
| 31 |
+
return firstArr.filter((firstItem) => {
|
| 32 |
+
return secondArr.every((secondItem) => {
|
| 33 |
+
return !areItemsEqual(firstItem, secondItem);
|
| 34 |
+
});
|
| 35 |
+
});
|
| 36 |
+
}
|
| 37 |
+
//#endregion
|
| 38 |
+
exports.differenceWith = differenceWith;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/differenceWith.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/differenceWith.ts
|
| 2 |
+
/**
|
| 3 |
+
* Computes the difference between two arrays based on a custom equality function.
|
| 4 |
+
*
|
| 5 |
+
* This function takes two arrays and a custom comparison function. It returns a new array containing
|
| 6 |
+
* the elements that are present in the first array but not in the second array. The comparison to determine
|
| 7 |
+
* if elements are equal is made using the provided custom function.
|
| 8 |
+
*
|
| 9 |
+
* @template T, U
|
| 10 |
+
* @param firstArr - The array from which to get the difference.
|
| 11 |
+
* @param secondArr - The array containing elements to exclude from the first array.
|
| 12 |
+
* @param areItemsEqual - A function to determine if two items are equal.
|
| 13 |
+
* @returns A new array containing the elements from the first array that do not match any elements in the second array
|
| 14 |
+
* according to the custom equality function.
|
| 15 |
+
*
|
| 16 |
+
* @example
|
| 17 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 18 |
+
* const array2 = [{ id: 2 }, { id: 4 }];
|
| 19 |
+
* const areItemsEqual = (a, b) => a.id === b.id;
|
| 20 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 21 |
+
* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
|
| 22 |
+
*
|
| 23 |
+
* @example
|
| 24 |
+
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
| 25 |
+
* const array2 = [2, 4];
|
| 26 |
+
* const areItemsEqual = (a, b) => a.id === b;
|
| 27 |
+
* const result = differenceWith(array1, array2, areItemsEqual);
|
| 28 |
+
* // 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.
|
| 29 |
+
*/
|
| 30 |
+
function differenceWith(firstArr, secondArr, areItemsEqual) {
|
| 31 |
+
return firstArr.filter((firstItem) => {
|
| 32 |
+
return secondArr.every((secondItem) => {
|
| 33 |
+
return !areItemsEqual(firstItem, secondItem);
|
| 34 |
+
});
|
| 35 |
+
});
|
| 36 |
+
}
|
| 37 |
+
//#endregion
|
| 38 |
+
export { differenceWith };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/drop.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the beginning of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the start.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the beginning of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the start.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = drop(array, 2);
|
| 16 |
+
* // result will be [3, 4, 5] since the first two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
declare function drop<T>(arr: readonly T[], itemsCount: number): T[];
|
| 19 |
+
//#endregion
|
| 20 |
+
export { drop };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/drop.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the beginning of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the start.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the beginning of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the start.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = drop(array, 2);
|
| 16 |
+
* // result will be [3, 4, 5] since the first two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
declare function drop<T>(arr: readonly T[], itemsCount: number): T[];
|
| 19 |
+
//#endregion
|
| 20 |
+
export { drop };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/drop.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the beginning of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the start.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the beginning of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the start.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = drop(array, 2);
|
| 16 |
+
* // result will be [3, 4, 5] since the first two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
function drop(arr, itemsCount) {
|
| 19 |
+
itemsCount = Math.max(itemsCount, 0);
|
| 20 |
+
return arr.slice(itemsCount);
|
| 21 |
+
}
|
| 22 |
+
//#endregion
|
| 23 |
+
exports.drop = drop;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/drop.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/drop.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the beginning of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the start.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the beginning of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the start.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = drop(array, 2);
|
| 16 |
+
* // result will be [3, 4, 5] since the first two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
function drop(arr, itemsCount) {
|
| 19 |
+
itemsCount = Math.max(itemsCount, 0);
|
| 20 |
+
return arr.slice(itemsCount);
|
| 21 |
+
}
|
| 22 |
+
//#endregion
|
| 23 |
+
export { drop };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/dropRight.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the end of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the end.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the end of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the end.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = dropRight(array, 2);
|
| 16 |
+
* // result will be [1, 2, 3] since the last two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
declare function dropRight<T>(arr: readonly T[], itemsCount: number): T[];
|
| 19 |
+
//#endregion
|
| 20 |
+
export { dropRight };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/dropRight.d.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the end of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the end.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the end of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the end.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = dropRight(array, 2);
|
| 16 |
+
* // result will be [1, 2, 3] since the last two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
declare function dropRight<T>(arr: readonly T[], itemsCount: number): T[];
|
| 19 |
+
//#endregion
|
| 20 |
+
export { dropRight };
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/dropRight.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the end of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the end.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the end of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the end.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = dropRight(array, 2);
|
| 16 |
+
* // result will be [1, 2, 3] since the last two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
function dropRight(arr, itemsCount) {
|
| 19 |
+
itemsCount = Math.min(-itemsCount, 0);
|
| 20 |
+
if (itemsCount === 0) return arr.slice();
|
| 21 |
+
return arr.slice(0, itemsCount);
|
| 22 |
+
}
|
| 23 |
+
//#endregion
|
| 24 |
+
exports.dropRight = dropRight;
|
astra_scene_test/X_03/node_modules/es-toolkit/dist/array/dropRight.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region src/array/dropRight.ts
|
| 2 |
+
/**
|
| 3 |
+
* Removes a specified number of elements from the end of an array and returns the rest.
|
| 4 |
+
*
|
| 5 |
+
* This function takes an array and a number, and returns a new array with the specified number
|
| 6 |
+
* of elements removed from the end.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of elements in the array.
|
| 9 |
+
* @param arr - The array from which to drop elements.
|
| 10 |
+
* @param itemsCount - The number of elements to drop from the end of the array.
|
| 11 |
+
* @returns A new array with the specified number of elements removed from the end.
|
| 12 |
+
*
|
| 13 |
+
* @example
|
| 14 |
+
* const array = [1, 2, 3, 4, 5];
|
| 15 |
+
* const result = dropRight(array, 2);
|
| 16 |
+
* // result will be [1, 2, 3] since the last two elements are dropped.
|
| 17 |
+
*/
|
| 18 |
+
function dropRight(arr, itemsCount) {
|
| 19 |
+
itemsCount = Math.min(-itemsCount, 0);
|
| 20 |
+
if (itemsCount === 0) return arr.slice();
|
| 21 |
+
return arr.slice(0, itemsCount);
|
| 22 |
+
}
|
| 23 |
+
//#endregion
|
| 24 |
+
export { dropRight };
|