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
38
frontend/node_modules/es-toolkit/dist/compat/math/maxBy.js
generated
vendored
Normal file
38
frontend/node_modules/es-toolkit/dist/compat/math/maxBy.js
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
const require_maxBy = require("../../array/maxBy.js");
|
||||
const require_identity = require("../../function/identity.js");
|
||||
const require_iteratee = require("../util/iteratee.js");
|
||||
//#region src/compat/math/maxBy.ts
|
||||
/**
|
||||
* Finds the element in an array that has the maximum value when applying
|
||||
* the `iteratee` to each element.
|
||||
*
|
||||
* @template T - The type of elements in the array.
|
||||
* @param items The array of elements to search.
|
||||
* @param iteratee
|
||||
* The criteria used to determine the maximum value.
|
||||
* - If a **function** is provided, it extracts a numeric value from each element.
|
||||
* - If a **string** is provided, it is treated as a key to extract values from the objects.
|
||||
* - If a **[key, value]** pair is provided, it matches elements with the specified key-value pair.
|
||||
* - If an **object** is provided, it matches elements that contain the specified properties.
|
||||
* @returns The element with the maximum value as determined by the `iteratee`.
|
||||
* @example
|
||||
* maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }
|
||||
* maxBy([], x => x.a); // Returns: undefined
|
||||
* maxBy(
|
||||
* [
|
||||
* { name: 'john', age: 30 },
|
||||
* { name: 'jane', age: 28 },
|
||||
* { name: 'joe', age: 26 },
|
||||
* ],
|
||||
* x => x.age
|
||||
* ); // Returns: { name: 'john', age: 30 }
|
||||
* maxBy([{ a: 1 }, { a: 2 }], 'a'); // Returns: { a: 2 }
|
||||
* maxBy([{ a: 1 }, { a: 2 }], ['a', 1]); // Returns: { a: 1 }
|
||||
* maxBy([{ a: 1 }, { a: 2 }], { a: 1 }); // Returns: { a: 1 }
|
||||
*/
|
||||
function maxBy(items, iteratee$1) {
|
||||
if (items == null) return;
|
||||
return require_maxBy.maxBy(Array.from(items), require_iteratee.iteratee(iteratee$1 ?? require_identity.identity));
|
||||
}
|
||||
//#endregion
|
||||
exports.maxBy = maxBy;
|
||||
Loading…
Add table
Add a link
Reference in a new issue