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
58
frontend/node_modules/es-toolkit/dist/fp/_internal/lazy.js
generated
vendored
Normal file
58
frontend/node_modules/es-toolkit/dist/fp/_internal/lazy.js
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
//#region src/fp/_internal/lazy.ts
|
||||
/**
|
||||
* Pairs an eager data-last function with a lazy transform (see
|
||||
* {@link createLazyFunction}).
|
||||
*
|
||||
* The returned function behaves exactly like `eager` when called directly. When
|
||||
* placed inside a {@link pipe}, the attached transform lets `pipe` fuse it with
|
||||
* adjacent lazy functions into a single, short-circuiting pass.
|
||||
*
|
||||
* @template Eager - The eager data-last function type.
|
||||
* @param eager - The eager `(array) => result` implementation.
|
||||
* @param lazy - The lazy transform built by {@link createLazyFunction}.
|
||||
* @param options - Set `shortCircuit: true` for functions that can end a run early.
|
||||
* @returns `eager`, augmented in place with the lazy metadata.
|
||||
*/
|
||||
function combineEagerAndLazyFunctions(eager, lazy, { shortCircuit } = {}) {
|
||||
return Object.assign(eager, {
|
||||
lazy,
|
||||
shortCircuit
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Builds a {@link LazyTransform} from a per-element `step`.
|
||||
*
|
||||
* `step` receives each input `value`, its zero-based `index` within this stage,
|
||||
* and an `emit` callback that forwards a result to the next stage. Call `emit`
|
||||
* zero times (drop), once (`map`), or many times (`flatMap`). Return
|
||||
* `false` to end the run after this element (used by short-circuiting functions
|
||||
* like `take`); returning nothing continues.
|
||||
*
|
||||
* @template T - The type of values entering this stage.
|
||||
* @template U - The type of values it emits.
|
||||
* @param step - The per-element push function.
|
||||
* @returns A lazy transform that `pipe` can fuse and drive.
|
||||
*
|
||||
* @example
|
||||
* // map
|
||||
* createLazyFunction<T, U>((value, index, emit) => {
|
||||
* emit(callback(value, index));
|
||||
* });
|
||||
*/
|
||||
function createLazyFunction(step) {
|
||||
return (emit) => {
|
||||
let index = 0;
|
||||
let active = true;
|
||||
const _emit = (value) => {
|
||||
if (!active) return;
|
||||
if (emit(value) === false) active = false;
|
||||
};
|
||||
return (value) => {
|
||||
if (step(value, index++, _emit) === false) active = false;
|
||||
return active;
|
||||
};
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
exports.combineEagerAndLazyFunctions = combineEagerAndLazyFunctions;
|
||||
exports.createLazyFunction = createLazyFunction;
|
||||
57
frontend/node_modules/es-toolkit/dist/fp/_internal/lazy.mjs
generated
vendored
Normal file
57
frontend/node_modules/es-toolkit/dist/fp/_internal/lazy.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//#region src/fp/_internal/lazy.ts
|
||||
/**
|
||||
* Pairs an eager data-last function with a lazy transform (see
|
||||
* {@link createLazyFunction}).
|
||||
*
|
||||
* The returned function behaves exactly like `eager` when called directly. When
|
||||
* placed inside a {@link pipe}, the attached transform lets `pipe` fuse it with
|
||||
* adjacent lazy functions into a single, short-circuiting pass.
|
||||
*
|
||||
* @template Eager - The eager data-last function type.
|
||||
* @param eager - The eager `(array) => result` implementation.
|
||||
* @param lazy - The lazy transform built by {@link createLazyFunction}.
|
||||
* @param options - Set `shortCircuit: true` for functions that can end a run early.
|
||||
* @returns `eager`, augmented in place with the lazy metadata.
|
||||
*/
|
||||
function combineEagerAndLazyFunctions(eager, lazy, { shortCircuit } = {}) {
|
||||
return Object.assign(eager, {
|
||||
lazy,
|
||||
shortCircuit
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Builds a {@link LazyTransform} from a per-element `step`.
|
||||
*
|
||||
* `step` receives each input `value`, its zero-based `index` within this stage,
|
||||
* and an `emit` callback that forwards a result to the next stage. Call `emit`
|
||||
* zero times (drop), once (`map`), or many times (`flatMap`). Return
|
||||
* `false` to end the run after this element (used by short-circuiting functions
|
||||
* like `take`); returning nothing continues.
|
||||
*
|
||||
* @template T - The type of values entering this stage.
|
||||
* @template U - The type of values it emits.
|
||||
* @param step - The per-element push function.
|
||||
* @returns A lazy transform that `pipe` can fuse and drive.
|
||||
*
|
||||
* @example
|
||||
* // map
|
||||
* createLazyFunction<T, U>((value, index, emit) => {
|
||||
* emit(callback(value, index));
|
||||
* });
|
||||
*/
|
||||
function createLazyFunction(step) {
|
||||
return (emit) => {
|
||||
let index = 0;
|
||||
let active = true;
|
||||
const _emit = (value) => {
|
||||
if (!active) return;
|
||||
if (emit(value) === false) active = false;
|
||||
};
|
||||
return (value) => {
|
||||
if (step(value, index++, _emit) === false) active = false;
|
||||
return active;
|
||||
};
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
export { combineEagerAndLazyFunctions, createLazyFunction };
|
||||
Loading…
Add table
Add a link
Reference in a new issue