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
59
frontend/node_modules/es-toolkit/dist/compat/util/cond.d.ts
generated
vendored
Normal file
59
frontend/node_modules/es-toolkit/dist/compat/util/cond.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
//#region src/compat/util/cond.d.ts
|
||||
/**
|
||||
* Creates a function that checks conditions one by one and runs the matching function.
|
||||
*
|
||||
* Each pair consists of a condition (predicate) and a function to run.
|
||||
* The function goes through each condition in order until it finds one that's true.
|
||||
* When it finds a true condition, it runs the corresponding function and returns its result.
|
||||
* If none of the conditions are true, it returns undefined.
|
||||
*
|
||||
* @param pairs - Array of pairs. Each pair consists of a predicate function and a function to run.
|
||||
* @returns A new composite function that checks conditions and runs the matching function.
|
||||
* @example
|
||||
*
|
||||
* const func = cond([
|
||||
* [matches({ a: 1 }), constant('matches A')],
|
||||
* [conforms({ b: isNumber }), constant('matches B')],
|
||||
* [stubTrue, constant('no match')]
|
||||
* ]);
|
||||
*
|
||||
* func({ a: 1, b: 2 });
|
||||
* // => 'matches A'
|
||||
*
|
||||
* func({ a: 0, b: 1 });
|
||||
* // => 'matches B'
|
||||
*
|
||||
* func({ a: '1', b: '2' });
|
||||
* // => 'no match'
|
||||
*/
|
||||
declare function cond<R>(pairs: Array<[truthy: () => boolean, falsey: () => R]>): () => R;
|
||||
/**
|
||||
* Creates a function that checks conditions one by one and runs the matching function.
|
||||
*
|
||||
* Each pair consists of a condition (predicate) and a function to run.
|
||||
* The function goes through each condition in order until it finds one that's true.
|
||||
* When it finds a true condition, it runs the corresponding function and returns its result.
|
||||
* If none of the conditions are true, it returns undefined.
|
||||
*
|
||||
* @param pairs - Array of pairs. Each pair consists of a predicate function and a function to run.
|
||||
* @returns A new composite function that checks conditions and runs the matching function.
|
||||
* @example
|
||||
*
|
||||
* const func = cond([
|
||||
* [matches({ a: 1 }), constant('matches A')],
|
||||
* [conforms({ b: isNumber }), constant('matches B')],
|
||||
* [stubTrue, constant('no match')]
|
||||
* ]);
|
||||
*
|
||||
* func({ a: 1, b: 2 });
|
||||
* // => 'matches A'
|
||||
*
|
||||
* func({ a: 0, b: 1 });
|
||||
* // => 'matches B'
|
||||
*
|
||||
* func({ a: '1', b: '2' });
|
||||
* // => 'no match'
|
||||
*/
|
||||
declare function cond<T, R>(pairs: Array<[truthy: (val: T) => boolean, falsey: (val: T) => R]>): (val: T) => R;
|
||||
//#endregion
|
||||
export { cond };
|
||||
Loading…
Add table
Add a link
Reference in a new issue