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
41
frontend/node_modules/es-toolkit/dist/compat/array/groupBy.mjs
generated
vendored
Normal file
41
frontend/node_modules/es-toolkit/dist/compat/array/groupBy.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { groupBy as groupBy$1 } from "../../array/groupBy.mjs";
|
||||
import { identity } from "../../function/identity.mjs";
|
||||
import { isArrayLike } from "../predicate/isArrayLike.mjs";
|
||||
import { iteratee } from "../util/iteratee.mjs";
|
||||
//#region src/compat/array/groupBy.ts
|
||||
/**
|
||||
* Groups the elements of an array or object based on a provided key-generating function.
|
||||
*
|
||||
* This function takes an array or object and a function that generates a key from each element or value.
|
||||
* It returns an object where the keys are the generated keys and the values are arrays of elements that
|
||||
* share the same key.
|
||||
*
|
||||
* @template T - The type of elements in the array or values in the object.
|
||||
* @template K - The type of keys.
|
||||
* @param source - The collection to group.
|
||||
* @param [_getKeyFromItem] - The iteratee to transform keys.
|
||||
* - If a function is provided, it's invoked for each element in the collection.
|
||||
* - If a property name (string) is provided, that property of each element is used as the key.
|
||||
* - If a property-value pair (array) is provided, elements with matching property values are used.
|
||||
* - If a partial object is provided, elements with matching properties are used.
|
||||
* @returns An object where each key is associated with an array of elements that
|
||||
* share that key.
|
||||
*
|
||||
* @example
|
||||
* // Using an array
|
||||
* const array = [6.1, 4.2, 6.3];
|
||||
* const result = groupBy(array, Math.floor);
|
||||
* // => { 4: [4.2], 6: [6.1, 6.3] }
|
||||
*
|
||||
* @example
|
||||
* // Using a property name
|
||||
* const array = ['one', 'two', 'three'];
|
||||
* const result = groupBy(array, 'length');
|
||||
* // => { 3: ['one', 'two'], 5: ['three'] }
|
||||
*/
|
||||
function groupBy(source, _getKeyFromItem) {
|
||||
if (source == null) return {};
|
||||
return groupBy$1(isArrayLike(source) ? Array.from(source) : Object.values(source), iteratee(_getKeyFromItem ?? identity));
|
||||
}
|
||||
//#endregion
|
||||
export { groupBy };
|
||||
Loading…
Add table
Add a link
Reference in a new issue