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
37
frontend/node_modules/es-toolkit/dist/compat/object/at.mjs
generated
vendored
Normal file
37
frontend/node_modules/es-toolkit/dist/compat/object/at.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
||||
import { get } from "./get.mjs";
|
||||
import { isString } from "../predicate/isString.mjs";
|
||||
//#region src/compat/object/at.ts
|
||||
/**
|
||||
* Returns an array of values corresponding to `paths` of `object`.
|
||||
*
|
||||
* @template T - The type of the object.
|
||||
* @param object - The object to iterate over.
|
||||
* @param [paths] - The property paths to pick.
|
||||
* @returns Returns the picked values.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* const object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
|
||||
*
|
||||
* at(object, ['a[0].b.c', 'a[1]']);
|
||||
* // => [3, 4]
|
||||
* ```
|
||||
*/
|
||||
function at(object, ...paths) {
|
||||
if (paths.length === 0) return [];
|
||||
const allPaths = [];
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
if (!isArrayLike(path) || isString(path)) {
|
||||
allPaths.push(path);
|
||||
continue;
|
||||
}
|
||||
for (let j = 0; j < path.length; j++) allPaths.push(path[j]);
|
||||
}
|
||||
const result = [];
|
||||
for (let i = 0; i < allPaths.length; i++) result.push(get(object, allPaths[i]));
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { at };
|
||||
Loading…
Add table
Add a link
Reference in a new issue