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
39
frontend/node_modules/es-toolkit/dist/fp/array/take.js
generated
vendored
Normal file
39
frontend/node_modules/es-toolkit/dist/fp/array/take.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
const require_take = require("../../array/take.js");
|
||||
const require_lazy = require("../_internal/lazy.js");
|
||||
//#region src/fp/array/take.ts
|
||||
/**
|
||||
* Creates a function that returns the first `count` elements of an array. If
|
||||
* `count` is greater than the array length, the whole array is returned. Use it
|
||||
* with {@link pipe}.
|
||||
*
|
||||
* The returned function is **lazy-capable** for a non-negative integer `count`:
|
||||
* inside a {@link pipe} it stops the walk as soon as `count` elements have been
|
||||
* collected, so preceding lazy functions never process the rest of the input.
|
||||
*
|
||||
* @template T - The type of elements in the array.
|
||||
* @param count - The number of elements to take from the front of the array.
|
||||
* @returns A function that maps a `readonly T[]` to a new `T[]`.
|
||||
*
|
||||
* @example
|
||||
* import { pipe, take } from 'es-toolkit/fp';
|
||||
*
|
||||
* pipe([1, 2, 3, 4, 5], take(3)); // => [1, 2, 3]
|
||||
*
|
||||
* @example
|
||||
* // Early termination: `map` only runs three times.
|
||||
* pipe([1, 2, 3, 4, 5], map(expensive), take(3));
|
||||
*/
|
||||
function take(count) {
|
||||
function takeEager(array) {
|
||||
return require_take.take(array, count);
|
||||
}
|
||||
if (!Number.isInteger(count) || count < 0) return takeEager;
|
||||
const takeLazy = require_lazy.createLazyFunction((value, index, emit) => {
|
||||
if (index >= count) return false;
|
||||
emit(value);
|
||||
return index < count - 1;
|
||||
});
|
||||
return require_lazy.combineEagerAndLazyFunctions(takeEager, takeLazy, { shortCircuit: true });
|
||||
}
|
||||
//#endregion
|
||||
exports.take = take;
|
||||
Loading…
Add table
Add a link
Reference in a new issue