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
27
frontend/node_modules/es-toolkit/dist/compat/object/fromPairs.mjs
generated
vendored
Normal file
27
frontend/node_modules/es-toolkit/dist/compat/object/fromPairs.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
||||
//#region src/compat/object/fromPairs.ts
|
||||
/**
|
||||
* Converts an array of key-value pairs into an object.
|
||||
*
|
||||
* @template T - The type of the keys in the resulting object. It must extend `PropertyKey`.
|
||||
* @template U - The type of the values in the resulting object.
|
||||
*
|
||||
* @param pairs - An array of key-value pairs where each key is a `PropertyKey` and each value is of type `U`.
|
||||
* @returns An object where the keys are of type `T` and the values are of type `U`.
|
||||
*
|
||||
* @example
|
||||
* const pairs = [['a', 1], ['b', 2]];
|
||||
* const result = fromPairs(pairs);
|
||||
* // result will be: { a: 1, b: 2 }
|
||||
*/
|
||||
function fromPairs(pairs) {
|
||||
if (!isArrayLike(pairs)) return {};
|
||||
const result = {};
|
||||
for (let i = 0; i < pairs.length; i++) {
|
||||
const [key, value] = pairs[i];
|
||||
result[key] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { fromPairs };
|
||||
Loading…
Add table
Add a link
Reference in a new issue