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