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
31
frontend/node_modules/es-toolkit/dist/compat/array/indexOf.mjs
generated
vendored
Normal file
31
frontend/node_modules/es-toolkit/dist/compat/array/indexOf.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
||||
//#region src/compat/array/indexOf.ts
|
||||
/**
|
||||
* Finds the index of the first occurrence of a value in an array.
|
||||
*
|
||||
* This method is similar to `Array.prototype.indexOf`, but it also finds `NaN` values.
|
||||
* It uses strict equality (`===`) to compare elements.
|
||||
*
|
||||
* @template T - The type of elements in the array.
|
||||
* @param array - The array to search.
|
||||
* @param searchElement - The value to search for.
|
||||
* @param [fromIndex] - The index to start the search at.
|
||||
* @returns The index (zero-based) of the first occurrence of the value in the array, or `-1` if the value is not found.
|
||||
*
|
||||
* @example
|
||||
* const array = [1, 2, 3, NaN];
|
||||
* indexOf(array, 3); // => 2
|
||||
* indexOf(array, NaN); // => 3
|
||||
*/
|
||||
function indexOf(array, searchElement, fromIndex) {
|
||||
if (!isArrayLike(array)) return -1;
|
||||
if (Number.isNaN(searchElement)) {
|
||||
fromIndex = fromIndex ?? 0;
|
||||
if (fromIndex < 0) fromIndex = Math.max(0, array.length + fromIndex);
|
||||
for (let i = fromIndex; i < array.length; i++) if (Number.isNaN(array[i])) return i;
|
||||
return -1;
|
||||
}
|
||||
return Array.from(array).indexOf(searchElement, fromIndex);
|
||||
}
|
||||
//#endregion
|
||||
export { indexOf };
|
||||
Loading…
Add table
Add a link
Reference in a new issue