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
34
frontend/node_modules/es-toolkit/dist/compat/function/wrap.js
generated
vendored
Normal file
34
frontend/node_modules/es-toolkit/dist/compat/function/wrap.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
const require_identity = require("../../function/identity.js");
|
||||
const require_isFunction = require("../../predicate/isFunction.js");
|
||||
//#region src/compat/function/wrap.ts
|
||||
/**
|
||||
* Creates a new function that wraps the given function `func`.
|
||||
* In this process, you can apply additional logic defined in the `wrapper` function before and after the execution of the original function.
|
||||
*
|
||||
* If a `value` is provided instead of a function, this value is passed as the first argument to the `wrapper` function.
|
||||
*
|
||||
* @template T - The type of the value being wrapped.
|
||||
* @template U - The type of the arguments being passed to the `wrapper` function.
|
||||
* @template V - The type of the return value of the `wrapper` function.
|
||||
* @param value - The value to be wrapped.
|
||||
* @param wrapper - The function to wrap the value with.
|
||||
* @returns A new function that wraps the value with the `wrapper` function.
|
||||
*
|
||||
* @example
|
||||
* // Wrap a function
|
||||
* const greet = (name: string) => `Hi, ${name}`;
|
||||
* const wrapped = wrap(greet, (value, name) => `[LOG] ${value(name)}`);
|
||||
* wrapped('Bob'); // => "[LOG] Hi, Bob"
|
||||
*
|
||||
* @example
|
||||
* // Wrap a primitive value
|
||||
* const wrapped = wrap('value', v => `<p>${v}</p>`);
|
||||
* wrapped(); // => "<p>value</p>"
|
||||
*/
|
||||
function wrap(value, wrapper) {
|
||||
return function(...args) {
|
||||
return (require_isFunction.isFunction(wrapper) ? wrapper : require_identity.identity).apply(this, [value, ...args]);
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
exports.wrap = wrap;
|
||||
Loading…
Add table
Add a link
Reference in a new issue