Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
29
frontend/node_modules/es-toolkit/dist/array/at.mjs
generated
vendored
Normal file
29
frontend/node_modules/es-toolkit/dist/array/at.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//#region src/array/at.ts
|
||||
/**
|
||||
* Retrieves elements from an array at the specified indices.
|
||||
*
|
||||
* This function supports negative indices, which count from the end of the array.
|
||||
*
|
||||
* @template T
|
||||
* @param arr - The array to retrieve elements from.
|
||||
* @param indices - An array of indices specifying the positions of elements to retrieve.
|
||||
* @returns A new array containing the elements at the specified indices.
|
||||
*
|
||||
* @example
|
||||
* const numbers = [10, 20, 30, 40, 50];
|
||||
* const result = at(numbers, [1, 3, 4]);
|
||||
* console.log(result); // [20, 40, 50]
|
||||
*/
|
||||
function at(arr, indices) {
|
||||
const result = new Array(indices.length);
|
||||
const length = arr.length;
|
||||
for (let i = 0; i < indices.length; i++) {
|
||||
let index = indices[i];
|
||||
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
|
||||
if (index < 0) index += length;
|
||||
result[i] = arr[index];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { at };
|
||||
Loading…
Add table
Add a link
Reference in a new issue