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:
jtricerolph 2026-07-20 14:37:36 +00:00
parent cae411eae7
commit 1c411e402e
19809 changed files with 1962608 additions and 97 deletions

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ArrayIterator.d.ts
type ArrayIterator<T, R> = (value: T, index: number, collection: T[]) => R;
//#endregion
export { ArrayIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ArrayIterator.d.ts
type ArrayIterator<T, R> = (value: T, index: number, collection: T[]) => R;
//#endregion
export { ArrayIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ConformsPredicateObject.d.ts
type ConformsPredicateObject<T> = { [P in keyof T]: T[P] extends ((arg: infer A) => any) ? A : any };
//#endregion
export { ConformsPredicateObject };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ConformsPredicateObject.d.ts
type ConformsPredicateObject<T> = { [P in keyof T]: T[P] extends ((arg: infer A) => any) ? A : any };
//#endregion
export { ConformsPredicateObject };

View file

@ -0,0 +1,5 @@
//#region src/compat/_internal/EmptyObjectOf.d.ts
type EmptyObject<T> = { [K in keyof T]?: never };
type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never;
//#endregion
export { EmptyObjectOf };

View file

@ -0,0 +1,5 @@
//#region src/compat/_internal/EmptyObjectOf.d.ts
type EmptyObject<T> = { [K in keyof T]?: never };
type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never;
//#endregion
export { EmptyObjectOf };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/Equals.d.ts
type Equals<T, U> = (<X>() => X extends T ? 1 : 2) extends (<X>() => X extends U ? 1 : 2) ? true : false;
//#endregion
export { Equals };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/Equals.d.ts
type Equals<T, U> = (<X>() => X extends T ? 1 : 2) extends (<X>() => X extends U ? 1 : 2) ? true : false;
//#endregion
export { Equals };

View file

@ -0,0 +1,13 @@
//#region src/compat/_internal/GetFieldType.d.ts
type GetFieldTypeOfArrayLikeByKey<T extends unknown[], K> = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined;
type GetFieldTypeOfStringByKey<T extends string, K> = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined;
type GetFieldTypeOfNarrowedByKey<T, K> = T extends unknown[] ? GetFieldTypeOfArrayLikeByKey<T, K> : T extends string ? GetFieldTypeOfStringByKey<T, K> : K extends keyof T ? T[K] : K extends number ? `${K}` extends keyof T ? T[`${K}`] : undefined : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : undefined : undefined;
type GetFieldTypeOfNarrowedByDotPath<T, P> = P extends `${infer L}.${infer R}` ? GetFieldType<GetFieldTypeOfNarrowedByKey<T, L>, R, 'DotPath'> : GetFieldTypeOfNarrowedByKey<T, P>;
type GetFieldTypeOfNarrowedByLcKR<T, Lc, K, R> = '' extends R ? GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'> : R extends `.${infer Rc}` ? GetFieldType<GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'>, Rc> : GetFieldType<GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'>, R>;
type GetFieldTypeOfNarrowedByLKR<T, L, K, R> = '' extends L ? '' extends R ? GetFieldTypeOfNarrowedByKey<T, K> : R extends `.${infer Rc}` ? GetFieldType<GetFieldTypeOfNarrowedByKey<T, K>, Rc> : GetFieldType<GetFieldTypeOfNarrowedByKey<T, K>, R> : L extends `${infer Lc}.` ? GetFieldTypeOfNarrowedByLcKR<T, Lc, K, R> : GetFieldTypeOfNarrowedByLcKR<T, L, K, R>;
type GetFieldTypeOfNarrowed<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = XT extends 'Key' ? GetFieldTypeOfNarrowedByKey<T, X> : XT extends 'DotPath' ? GetFieldTypeOfNarrowedByDotPath<T, X> : X extends `${infer L}['${infer K}']${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : X extends `${infer L}["${infer K}"]${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : X extends `${infer L}[${infer K}]${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : GetFieldTypeOfNarrowedByDotPath<T, X>;
type GetFieldTypeOfObject<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = Extract<T, unknown[]> extends never ? GetFieldTypeOfNarrowed<T, X, XT> : GetFieldTypeOfNarrowed<Exclude<T, unknown[]>, X, XT> | GetFieldTypeOfNarrowed<Extract<T, unknown[]>, X, XT>;
type GetFieldTypeOfPrimitive<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = Extract<T, string> extends never ? T extends never ? never : undefined : (Exclude<T, string> extends never ? never : undefined) | GetFieldTypeOfNarrowed<Extract<T, string>, X, XT>;
type GetFieldType<T, X, XT extends 'DotPath' | 'Key' | 'Path' = 'Path'> = Extract<T, object> extends never ? GetFieldTypeOfPrimitive<T, X, XT> : GetFieldTypeOfPrimitive<Exclude<T, object>, X, XT> | GetFieldTypeOfObject<Extract<T, object>, X, XT>;
//#endregion
export { GetFieldType };

View file

@ -0,0 +1,13 @@
//#region src/compat/_internal/GetFieldType.d.ts
type GetFieldTypeOfArrayLikeByKey<T extends unknown[], K> = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined;
type GetFieldTypeOfStringByKey<T extends string, K> = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined;
type GetFieldTypeOfNarrowedByKey<T, K> = T extends unknown[] ? GetFieldTypeOfArrayLikeByKey<T, K> : T extends string ? GetFieldTypeOfStringByKey<T, K> : K extends keyof T ? T[K] : K extends number ? `${K}` extends keyof T ? T[`${K}`] : undefined : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : undefined : undefined;
type GetFieldTypeOfNarrowedByDotPath<T, P> = P extends `${infer L}.${infer R}` ? GetFieldType<GetFieldTypeOfNarrowedByKey<T, L>, R, 'DotPath'> : GetFieldTypeOfNarrowedByKey<T, P>;
type GetFieldTypeOfNarrowedByLcKR<T, Lc, K, R> = '' extends R ? GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'> : R extends `.${infer Rc}` ? GetFieldType<GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'>, Rc> : GetFieldType<GetFieldType<GetFieldTypeOfNarrowedByDotPath<T, Lc>, K, 'Key'>, R>;
type GetFieldTypeOfNarrowedByLKR<T, L, K, R> = '' extends L ? '' extends R ? GetFieldTypeOfNarrowedByKey<T, K> : R extends `.${infer Rc}` ? GetFieldType<GetFieldTypeOfNarrowedByKey<T, K>, Rc> : GetFieldType<GetFieldTypeOfNarrowedByKey<T, K>, R> : L extends `${infer Lc}.` ? GetFieldTypeOfNarrowedByLcKR<T, Lc, K, R> : GetFieldTypeOfNarrowedByLcKR<T, L, K, R>;
type GetFieldTypeOfNarrowed<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = XT extends 'Key' ? GetFieldTypeOfNarrowedByKey<T, X> : XT extends 'DotPath' ? GetFieldTypeOfNarrowedByDotPath<T, X> : X extends `${infer L}['${infer K}']${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : X extends `${infer L}["${infer K}"]${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : X extends `${infer L}[${infer K}]${infer R}` ? GetFieldTypeOfNarrowedByLKR<T, L, K, R> : GetFieldTypeOfNarrowedByDotPath<T, X>;
type GetFieldTypeOfObject<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = Extract<T, unknown[]> extends never ? GetFieldTypeOfNarrowed<T, X, XT> : GetFieldTypeOfNarrowed<Exclude<T, unknown[]>, X, XT> | GetFieldTypeOfNarrowed<Extract<T, unknown[]>, X, XT>;
type GetFieldTypeOfPrimitive<T, X, XT extends 'DotPath' | 'Key' | 'Path'> = Extract<T, string> extends never ? T extends never ? never : undefined : (Exclude<T, string> extends never ? never : undefined) | GetFieldTypeOfNarrowed<Extract<T, string>, X, XT>;
type GetFieldType<T, X, XT extends 'DotPath' | 'Key' | 'Path' = 'Path'> = Extract<T, object> extends never ? GetFieldTypeOfPrimitive<T, X, XT> : GetFieldTypeOfPrimitive<Exclude<T, object>, X, XT> | GetFieldTypeOfObject<Extract<T, object>, X, XT>;
//#endregion
export { GetFieldType };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/IsEqualCustomizer.d.ts
type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyKey | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined;
//#endregion
export { IsEqualCustomizer };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/IsEqualCustomizer.d.ts
type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyKey | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined;
//#endregion
export { IsEqualCustomizer };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/IsMatchWithCustomizer.d.ts
type IsMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyKey, object: object, source: object) => boolean | undefined;
//#endregion
export { IsMatchWithCustomizer };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/IsMatchWithCustomizer.d.ts
type IsMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyKey, object: object, source: object) => boolean | undefined;
//#endregion
export { IsMatchWithCustomizer };

View file

@ -0,0 +1,6 @@
import { Equals } from "./Equals.mjs";
//#region src/compat/_internal/IsWritable.d.ts
type IsWritable<T> = Equals<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>;
//#endregion
export { IsWritable };

View file

@ -0,0 +1,6 @@
import { Equals } from "./Equals.js";
//#region src/compat/_internal/IsWritable.d.ts
type IsWritable<T> = Equals<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>;
//#endregion
export { IsWritable };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.mjs";
//#region src/compat/_internal/IterateeShorthand.d.ts
type IterateeShorthand<T> = PropertyKey | [PropertyKey, any] | PartialShallow<T>;
//#endregion
export { IterateeShorthand };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.js";
//#region src/compat/_internal/IterateeShorthand.d.ts
type IterateeShorthand<T> = PropertyKey | [PropertyKey, any] | PartialShallow<T>;
//#endregion
export { IterateeShorthand };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.mjs";
//#region src/compat/_internal/ListIteratee.d.ts
type ListIteratee<T> = ((value: T, index: number, collection: ArrayLike<T>) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ListIteratee };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.js";
//#region src/compat/_internal/ListIteratee.d.ts
type ListIteratee<T> = ((value: T, index: number, collection: ArrayLike<T>) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ListIteratee };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.mjs";
//#region src/compat/_internal/ListIterateeCustom.d.ts
type ListIterateeCustom<T, R> = ((value: T, index: number, collection: ArrayLike<T>) => R) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ListIterateeCustom };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.js";
//#region src/compat/_internal/ListIterateeCustom.d.ts
type ListIterateeCustom<T, R> = ((value: T, index: number, collection: ArrayLike<T>) => R) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ListIterateeCustom };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ListIterator.d.ts
type ListIterator<T, R> = (value: T, index: number, collection: ArrayLike<T>) => R;
//#endregion
export { ListIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ListIterator.d.ts
type ListIterator<T, R> = (value: T, index: number, collection: ArrayLike<T>) => R;
//#endregion
export { ListIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ListIteratorTypeGuard.d.ts
type ListIteratorTypeGuard<T, S extends T> = (value: T, index: number, collection: ArrayLike<T>) => value is S;
//#endregion
export { ListIteratorTypeGuard };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ListIteratorTypeGuard.d.ts
type ListIteratorTypeGuard<T, S extends T> = (value: T, index: number, collection: ArrayLike<T>) => value is S;
//#endregion
export { ListIteratorTypeGuard };

View file

@ -0,0 +1,6 @@
import { RecursiveArray } from "./RecursiveArray.mjs";
//#region src/compat/_internal/ListOfRecursiveArraysOrValues.d.ts
interface ListOfRecursiveArraysOrValues<T> extends ArrayLike<T | RecursiveArray<T>> {}
//#endregion
export { ListOfRecursiveArraysOrValues };

View file

@ -0,0 +1,6 @@
import { RecursiveArray } from "./RecursiveArray.js";
//#region src/compat/_internal/ListOfRecursiveArraysOrValues.d.ts
interface ListOfRecursiveArraysOrValues<T> extends ArrayLike<T | RecursiveArray<T>> {}
//#endregion
export { ListOfRecursiveArraysOrValues };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MAX_ARRAY_LENGTH.ts
const MAX_ARRAY_LENGTH = 4294967295;
//#endregion
exports.MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH;

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MAX_ARRAY_LENGTH.ts
const MAX_ARRAY_LENGTH = 4294967295;
//#endregion
export { MAX_ARRAY_LENGTH };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MAX_SAFE_INTEGER.ts
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
//#endregion
exports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MAX_SAFE_INTEGER.ts
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
//#endregion
export { MAX_SAFE_INTEGER };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/Many.d.ts
type Many<T> = T | readonly T[];
//#endregion
export { Many };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/Many.d.ts
type Many<T> = T | readonly T[];
//#endregion
export { Many };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MemoListIterator.d.ts
type MemoListIterator<T, R, A> = (prev: R, curr: T, index: number, list: A) => R;
//#endregion
export { MemoListIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MemoListIterator.d.ts
type MemoListIterator<T, R, A> = (prev: R, curr: T, index: number, list: A) => R;
//#endregion
export { MemoListIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MemoObjectIterator.d.ts
type MemoObjectIterator<T, R, A> = (prev: R, curr: T, key: string, list: A) => R;
//#endregion
export { MemoObjectIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/MemoObjectIterator.d.ts
type MemoObjectIterator<T, R, A> = (prev: R, curr: T, key: string, list: A) => R;
//#endregion
export { MemoObjectIterator };

View file

@ -0,0 +1,7 @@
//#region src/compat/_internal/MutableList.d.ts
interface MutableList<T> {
length: number;
[k: number]: T;
}
//#endregion
export { MutableList };

View file

@ -0,0 +1,7 @@
//#region src/compat/_internal/MutableList.d.ts
interface MutableList<T> {
length: number;
[k: number]: T;
}
//#endregion
export { MutableList };

View file

@ -0,0 +1,8 @@
import { ObjectIterator } from "./ObjectIterator.mjs";
import { IterateeShorthand } from "./IterateeShorthand.mjs";
//#region src/compat/_internal/ObjectIteratee.d.ts
type ObjectIteratee<TObject> = ObjectIterator<TObject, unknown> | IterateeShorthand<TObject[keyof TObject]>;
type ObjectIterateeCustom<TObject, TResult> = ObjectIterator<TObject, TResult> | IterateeShorthand<TObject[keyof TObject]>;
//#endregion
export { ObjectIteratee, ObjectIterateeCustom };

View file

@ -0,0 +1,8 @@
import { ObjectIterator } from "./ObjectIterator.js";
import { IterateeShorthand } from "./IterateeShorthand.js";
//#region src/compat/_internal/ObjectIteratee.d.ts
type ObjectIteratee<TObject> = ObjectIterator<TObject, unknown> | IterateeShorthand<TObject[keyof TObject]>;
type ObjectIterateeCustom<TObject, TResult> = ObjectIterator<TObject, TResult> | IterateeShorthand<TObject[keyof TObject]>;
//#endregion
export { ObjectIteratee, ObjectIterateeCustom };

View file

@ -0,0 +1,5 @@
//#region src/compat/_internal/ObjectIterator.d.ts
type ObjectIterator<T, R> = (value: T[keyof T], key: string, collection: T) => R;
type ObjectIteratorTypeGuard<T, U extends T[keyof T]> = (value: T[keyof T], key: string, collection: T) => value is U;
//#endregion
export { ObjectIterator, ObjectIteratorTypeGuard };

View file

@ -0,0 +1,5 @@
//#region src/compat/_internal/ObjectIterator.d.ts
type ObjectIterator<T, R> = (value: T[keyof T], key: string, collection: T) => R;
type ObjectIteratorTypeGuard<T, U extends T[keyof T]> = (value: T[keyof T], key: string, collection: T) => value is U;
//#endregion
export { ObjectIterator, ObjectIteratorTypeGuard };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/PartialShallow.d.ts
type PartialShallow<T> = { [P in keyof T]?: T[P] extends object ? object : T[P] };
//#endregion
export { PartialShallow };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/PartialShallow.d.ts
type PartialShallow<T> = { [P in keyof T]?: T[P] extends object ? object : T[P] };
//#endregion
export { PartialShallow };

View file

@ -0,0 +1,6 @@
import { Many } from "./Many.mjs";
//#region src/compat/_internal/PropertyPath.d.ts
type PropertyPath = Many<PropertyKey>;
//#endregion
export { PropertyPath };

View file

@ -0,0 +1,6 @@
import { Many } from "./Many.js";
//#region src/compat/_internal/PropertyPath.d.ts
type PropertyPath = Many<PropertyKey>;
//#endregion
export { PropertyPath };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/RecursiveArray.d.ts
interface RecursiveArray<T> extends Array<T | RecursiveArray<T>> {}
//#endregion
export { RecursiveArray };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/RecursiveArray.d.ts
interface RecursiveArray<T> extends Array<T | RecursiveArray<T>> {}
//#endregion
export { RecursiveArray };

View file

@ -0,0 +1,7 @@
import { MutableList } from "./MutableList.mjs";
import { IsWritable } from "./IsWritable.mjs";
//#region src/compat/_internal/RejectReadonly.d.ts
type RejectReadonly<T extends MutableList<unknown>> = IsWritable<T> extends true ? T : never;
//#endregion
export { RejectReadonly };

View file

@ -0,0 +1,7 @@
import { MutableList } from "./MutableList.js";
import { IsWritable } from "./IsWritable.js";
//#region src/compat/_internal/RejectReadonly.d.ts
type RejectReadonly<T extends MutableList<unknown>> = IsWritable<T> extends true ? T : never;
//#endregion
export { RejectReadonly };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/StringIterator.d.ts
type StringIterator<R> = (char: string, index: number, string: string) => R;
//#endregion
export { StringIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/StringIterator.d.ts
type StringIterator<R> = (char: string, index: number, string: string) => R;
//#endregion
export { StringIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/TupleIterator.d.ts
type TupleIterator<T extends readonly unknown[], TResult> = (value: T[number], index: T extends `${infer N extends number}` ? N : never, collection: T) => TResult;
//#endregion
export { TupleIterator };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/TupleIterator.d.ts
type TupleIterator<T extends readonly unknown[], TResult> = (value: T[number], index: T extends `${infer N extends number}` ? N : never, collection: T) => TResult;
//#endregion
export { TupleIterator };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.mjs";
//#region src/compat/_internal/ValueIteratee.d.ts
type ValueIteratee<T> = ((value: T) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ValueIteratee };

View file

@ -0,0 +1,6 @@
import { PartialShallow } from "./PartialShallow.js";
//#region src/compat/_internal/ValueIteratee.d.ts
type ValueIteratee<T> = ((value: T) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow<T>);
//#endregion
export { ValueIteratee };

View file

@ -0,0 +1,6 @@
import { IterateeShorthand } from "./IterateeShorthand.mjs";
//#region src/compat/_internal/ValueIterateeCustom.d.ts
type ValueIterateeCustom<T, TResult> = ((value: T) => TResult) | IterateeShorthand<T>;
//#endregion
export { ValueIterateeCustom };

View file

@ -0,0 +1,6 @@
import { IterateeShorthand } from "./IterateeShorthand.js";
//#region src/compat/_internal/ValueIterateeCustom.d.ts
type ValueIterateeCustom<T, TResult> = ((value: T) => TResult) | IterateeShorthand<T>;
//#endregion
export { ValueIterateeCustom };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ValueIteratorTypeGuard.d.ts
type ValueIteratorTypeGuard<T, S extends T> = (value: T) => value is S;
//#endregion
export { ValueIteratorTypeGuard };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ValueIteratorTypeGuard.d.ts
type ValueIteratorTypeGuard<T, S extends T> = (value: T) => value is S;
//#endregion
export { ValueIteratorTypeGuard };

View file

@ -0,0 +1,6 @@
import { IterateeShorthand } from "./IterateeShorthand.mjs";
//#region src/compat/_internal/ValueKeyIteratee.d.ts
type ValueKeyIteratee<T> = ((value: T, key: string) => unknown) | IterateeShorthand<T>;
//#endregion
export { ValueKeyIteratee };

View file

@ -0,0 +1,6 @@
import { IterateeShorthand } from "./IterateeShorthand.js";
//#region src/compat/_internal/ValueKeyIteratee.d.ts
type ValueKeyIteratee<T> = ((value: T, key: string) => unknown) | IterateeShorthand<T>;
//#endregion
export { ValueKeyIteratee };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ValueKeyIterateeTypeGuard.d.ts
type ValueKeyIterateeTypeGuard<T, S extends T> = (value: T, key: string) => value is S;
//#endregion
export { ValueKeyIterateeTypeGuard };

View file

@ -0,0 +1,4 @@
//#region src/compat/_internal/ValueKeyIterateeTypeGuard.d.ts
type ValueKeyIterateeTypeGuard<T, S extends T> = (value: T, key: string) => value is S;
//#endregion
export { ValueKeyIterateeTypeGuard };

View file

@ -0,0 +1,9 @@
const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js");
require("../util/eq.js");
//#region src/compat/_internal/assignValue.ts
const assignValue = (object, key, value) => {
const objValue = object[key];
if (!(Object.hasOwn(object, key) && require_isEqualsSameValueZero.isEqualsSameValueZero(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
};
//#endregion
exports.assignValue = assignValue;

View file

@ -0,0 +1,9 @@
import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs";
import "../util/eq.mjs";
//#region src/compat/_internal/assignValue.ts
const assignValue = (object, key, value) => {
const objValue = object[key];
if (!(Object.hasOwn(object, key) && isEqualsSameValueZero(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
};
//#endregion
export { assignValue };

View file

@ -0,0 +1,22 @@
//#region src/compat/_internal/compareValues.ts
function getPriority(a) {
if (typeof a === "symbol") return 1;
if (a === null) return 2;
if (a === void 0) return 3;
if (a !== a) return 4;
return 0;
}
const compareValues = (a, b, order) => {
if (a !== b) {
const aPriority = getPriority(a);
const bPriority = getPriority(b);
if (aPriority === bPriority && aPriority === 0) {
if (a < b) return order === "desc" ? 1 : -1;
if (a > b) return order === "desc" ? -1 : 1;
}
return order === "desc" ? bPriority - aPriority : aPriority - bPriority;
}
return 0;
};
//#endregion
exports.compareValues = compareValues;

View file

@ -0,0 +1,22 @@
//#region src/compat/_internal/compareValues.ts
function getPriority(a) {
if (typeof a === "symbol") return 1;
if (a === null) return 2;
if (a === void 0) return 3;
if (a !== a) return 4;
return 0;
}
const compareValues = (a, b, order) => {
if (a !== b) {
const aPriority = getPriority(a);
const bPriority = getPriority(b);
if (aPriority === bPriority && aPriority === 0) {
if (a < b) return order === "desc" ? 1 : -1;
if (a > b) return order === "desc" ? -1 : 1;
}
return order === "desc" ? bPriority - aPriority : aPriority - bPriority;
}
return 0;
};
//#endregion
export { compareValues };

View file

@ -0,0 +1,17 @@
//#region src/compat/_internal/copyArray.ts
/**
* Copies the values of `source` to `array`.
*
* @template T
* @param {ArrayLike<T>} source The array to copy values from.
* @param {T[]} [array=[]] The array to copy values to.
* @returns {T[]} Returns `array`.
*/
function copyArray(source, array) {
const length = source.length;
if (array == null) array = Array(length);
for (let i = 0; i < length; i++) array[i] = source[i];
return array;
}
//#endregion
exports.default = copyArray;

View file

@ -0,0 +1,17 @@
//#region src/compat/_internal/copyArray.ts
/**
* Copies the values of `source` to `array`.
*
* @template T
* @param {ArrayLike<T>} source The array to copy values from.
* @param {T[]} [array=[]] The array to copy values to.
* @returns {T[]} Returns `array`.
*/
function copyArray(source, array) {
const length = source.length;
if (array == null) array = Array(length);
for (let i = 0; i < length; i++) array[i] = source[i];
return array;
}
//#endregion
export { copyArray as default };

View file

@ -0,0 +1,16 @@
//#region src/compat/_internal/decimalAdjust.ts
function decimalAdjust(type, number, precision = 0) {
number = Number(number);
if (Object.is(number, -0)) number = "-0";
precision = Math.min(Number.parseInt(precision, 10), 292);
if (precision && Number.isFinite(Number(number))) {
const [magnitude, exponent = 0] = number.toString().split("e");
let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`));
if (Object.is(adjustedValue, -0)) adjustedValue = "-0";
const [newMagnitude, newExponent = 0] = adjustedValue.toString().split("e");
return Number(`${newMagnitude}e${Number(newExponent) - precision}`);
}
return Math[type](Number(number));
}
//#endregion
exports.decimalAdjust = decimalAdjust;

View file

@ -0,0 +1,16 @@
//#region src/compat/_internal/decimalAdjust.ts
function decimalAdjust(type, number, precision = 0) {
number = Number(number);
if (Object.is(number, -0)) number = "-0";
precision = Math.min(Number.parseInt(precision, 10), 292);
if (precision && Number.isFinite(Number(number))) {
const [magnitude, exponent = 0] = number.toString().split("e");
let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`));
if (Object.is(adjustedValue, -0)) adjustedValue = "-0";
const [newMagnitude, newExponent = 0] = adjustedValue.toString().split("e");
return Number(`${newMagnitude}e${Number(newExponent) - precision}`);
}
return Math[type](Number(number));
}
//#endregion
export { decimalAdjust };

View file

@ -0,0 +1,13 @@
const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js");
//#region src/compat/_internal/flattenArrayLike.ts
function flattenArrayLike(values) {
const result = [];
for (let i = 0; i < values.length; i++) {
const arrayLike = values[i];
if (!require_isArrayLikeObject.isArrayLikeObject(arrayLike)) continue;
for (let j = 0; j < arrayLike.length; j++) result.push(arrayLike[j]);
}
return result;
}
//#endregion
exports.flattenArrayLike = flattenArrayLike;

View file

@ -0,0 +1,13 @@
import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs";
//#region src/compat/_internal/flattenArrayLike.ts
function flattenArrayLike(values) {
const result = [];
for (let i = 0; i < values.length; i++) {
const arrayLike = values[i];
if (!isArrayLikeObject(arrayLike)) continue;
for (let j = 0; j < arrayLike.length; j++) result.push(arrayLike[j]);
}
return result;
}
//#endregion
export { flattenArrayLike };

View file

@ -0,0 +1,6 @@
//#region src/compat/_internal/getSymbols.ts
function getSymbols(object) {
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
}
//#endregion
exports.getSymbols = getSymbols;

View file

@ -0,0 +1,6 @@
//#region src/compat/_internal/getSymbols.ts
function getSymbols(object) {
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
}
//#endregion
export { getSymbols };

View file

@ -0,0 +1,12 @@
const require_getSymbols = require("./getSymbols.js");
//#region src/compat/_internal/getSymbolsIn.ts
function getSymbolsIn(object) {
const result = [];
while (object) {
result.push(...require_getSymbols.getSymbols(object));
object = Object.getPrototypeOf(object);
}
return result;
}
//#endregion
exports.getSymbolsIn = getSymbolsIn;

View file

@ -0,0 +1,12 @@
import { getSymbols } from "./getSymbols.mjs";
//#region src/compat/_internal/getSymbolsIn.ts
function getSymbolsIn(object) {
const result = [];
while (object) {
result.push(...getSymbols(object));
object = Object.getPrototypeOf(object);
}
return result;
}
//#endregion
export { getSymbolsIn };

View file

@ -0,0 +1,14 @@
//#region src/compat/_internal/getTag.ts
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {T} value The value to query.
* @returns {string} Returns the `Object.prototype.toString.call` result.
*/
function getTag(value) {
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
return Object.prototype.toString.call(value);
}
//#endregion
exports.getTag = getTag;

View file

@ -0,0 +1,14 @@
//#region src/compat/_internal/getTag.ts
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {T} value The value to query.
* @returns {string} Returns the `Object.prototype.toString.call` result.
*/
function getTag(value) {
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
return Object.prototype.toString.call(value);
}
//#endregion
export { getTag };

View file

@ -0,0 +1,27 @@
//#region src/compat/_internal/isDeepKey.ts
/**
* Checks if a given key is a deep key.
*
* A deep key is a string that contains a dot (.) or square brackets with a property accessor.
*
* @param {PropertyKey} key - The key to check.
* @returns {boolean} - Returns true if the key is a deep key, otherwise false.
*
* Examples:
*
* isDeepKey('a.b') // true
* isDeepKey('a[b]') // true
* isDeepKey('a') // false
* isDeepKey(123) // false
* isDeepKey('a.b.c') // true
* isDeepKey('a[b][c]') // true
*/
function isDeepKey(key) {
switch (typeof key) {
case "number":
case "symbol": return false;
case "string": return key.includes(".") || key.includes("[") || key.includes("]");
}
}
//#endregion
exports.isDeepKey = isDeepKey;

View file

@ -0,0 +1,27 @@
//#region src/compat/_internal/isDeepKey.ts
/**
* Checks if a given key is a deep key.
*
* A deep key is a string that contains a dot (.) or square brackets with a property accessor.
*
* @param {PropertyKey} key - The key to check.
* @returns {boolean} - Returns true if the key is a deep key, otherwise false.
*
* Examples:
*
* isDeepKey('a.b') // true
* isDeepKey('a[b]') // true
* isDeepKey('a') // false
* isDeepKey(123) // false
* isDeepKey('a.b.c') // true
* isDeepKey('a[b][c]') // true
*/
function isDeepKey(key) {
switch (typeof key) {
case "number":
case "symbol": return false;
case "string": return key.includes(".") || key.includes("[") || key.includes("]");
}
}
//#endregion
export { isDeepKey };

View file

@ -0,0 +1,11 @@
//#region src/compat/_internal/isIndex.ts
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
switch (typeof value) {
case "number": return Number.isInteger(value) && value >= 0 && value < length;
case "symbol": return false;
case "string": return IS_UNSIGNED_INTEGER.test(value);
}
}
//#endregion
exports.isIndex = isIndex;

View file

@ -0,0 +1,11 @@
//#region src/compat/_internal/isIndex.ts
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
switch (typeof value) {
case "number": return Number.isInteger(value) && value >= 0 && value < length;
case "symbol": return false;
case "string": return IS_UNSIGNED_INTEGER.test(value);
}
}
//#endregion
export { isIndex };

View file

@ -0,0 +1,13 @@
const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js");
require("../util/eq.js");
const require_isArrayLike = require("../predicate/isArrayLike.js");
const require_isObject = require("../predicate/isObject.js");
const require_isIndex = require("./isIndex.js");
//#region src/compat/_internal/isIterateeCall.ts
function isIterateeCall(value, index, object) {
if (!require_isObject.isObject(object)) return false;
if (typeof index === "number" && require_isArrayLike.isArrayLike(object) && require_isIndex.isIndex(index) && index < object.length || typeof index === "string" && index in object) return require_isEqualsSameValueZero.isEqualsSameValueZero(object[index], value);
return false;
}
//#endregion
exports.isIterateeCall = isIterateeCall;

View file

@ -0,0 +1,13 @@
import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs";
import "../util/eq.mjs";
import { isArrayLike } from "../predicate/isArrayLike.mjs";
import { isObject } from "../predicate/isObject.mjs";
import { isIndex } from "./isIndex.mjs";
//#region src/compat/_internal/isIterateeCall.ts
function isIterateeCall(value, index, object) {
if (!isObject(object)) return false;
if (typeof index === "number" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === "string" && index in object) return isEqualsSameValueZero(object[index], value);
return false;
}
//#endregion
export { isIterateeCall };

View file

@ -0,0 +1,26 @@
const require_isSymbol = require("../predicate/isSymbol.js");
//#region src/compat/_internal/isKey.ts
/** Matches any deep property path. (e.g. `a.b[0].c`)*/
const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
/** Matches any word character (alphanumeric & underscore).*/
const regexIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`)
* @param {unknown} value The value to check.
* @param {unknown} object The object to query.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*
* @example
* isKey('a', { a: 1 });
* // => true
*
* isKey('a.b', { a: { b: 2 } });
* // => false
*/
function isKey(value, object) {
if (Array.isArray(value)) return false;
if (typeof value === "number" || typeof value === "boolean" || value == null || require_isSymbol.isSymbol(value)) return true;
return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);
}
//#endregion
exports.isKey = isKey;

View file

@ -0,0 +1,26 @@
import { isSymbol } from "../predicate/isSymbol.mjs";
//#region src/compat/_internal/isKey.ts
/** Matches any deep property path. (e.g. `a.b[0].c`)*/
const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
/** Matches any word character (alphanumeric & underscore).*/
const regexIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`)
* @param {unknown} value The value to check.
* @param {unknown} object The object to query.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*
* @example
* isKey('a', { a: 1 });
* // => true
*
* isKey('a.b', { a: { b: 2 } });
* // => false
*/
function isKey(value, object) {
if (Array.isArray(value)) return false;
if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol(value)) return true;
return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);
}
//#endregion
export { isKey };

View file

@ -0,0 +1,7 @@
//#region src/compat/_internal/isPrototype.ts
function isPrototype(value) {
const constructor = value?.constructor;
return value === (typeof constructor === "function" ? constructor.prototype : Object.prototype);
}
//#endregion
exports.isPrototype = isPrototype;

View file

@ -0,0 +1,7 @@
//#region src/compat/_internal/isPrototype.ts
function isPrototype(value) {
const constructor = value?.constructor;
return value === (typeof constructor === "function" ? constructor.prototype : Object.prototype);
}
//#endregion
export { isPrototype };

View file

@ -0,0 +1,10 @@
//#region src/compat/_internal/mapToEntries.ts
function mapToEntries(map) {
const arr = new Array(map.size);
const keys = map.keys();
const values = map.values();
for (let i = 0; i < arr.length; i++) arr[i] = [keys.next().value, values.next().value];
return arr;
}
//#endregion
exports.mapToEntries = mapToEntries;

View file

@ -0,0 +1,10 @@
//#region src/compat/_internal/mapToEntries.ts
function mapToEntries(map) {
const arr = new Array(map.size);
const keys = map.keys();
const values = map.values();
for (let i = 0; i < arr.length; i++) arr[i] = [keys.next().value, values.next().value];
return arr;
}
//#endregion
export { mapToEntries };

View file

@ -0,0 +1,8 @@
const require_toString = require("../util/toString.js");
//#region src/compat/_internal/normalizeForCase.ts
function normalizeForCase(str) {
if (typeof str !== "string") str = require_toString.toString(str);
return str.replace(/['\u2019]/g, "");
}
//#endregion
exports.normalizeForCase = normalizeForCase;

View file

@ -0,0 +1,8 @@
import { toString } from "../util/toString.mjs";
//#region src/compat/_internal/normalizeForCase.ts
function normalizeForCase(str) {
if (typeof str !== "string") str = toString(str);
return str.replace(/['\u2019]/g, "");
}
//#endregion
export { normalizeForCase };

View file

@ -0,0 +1,12 @@
//#region src/compat/_internal/setToEntries.ts
function setToEntries(set) {
const arr = new Array(set.size);
const values = set.values();
for (let i = 0; i < arr.length; i++) {
const value = values.next().value;
arr[i] = [value, value];
}
return arr;
}
//#endregion
exports.setToEntries = setToEntries;

View file

@ -0,0 +1,12 @@
//#region src/compat/_internal/setToEntries.ts
function setToEntries(set) {
const arr = new Array(set.size);
const values = set.values();
for (let i = 0; i < arr.length; i++) {
const value = values.next().value;
arr[i] = [value, value];
}
return arr;
}
//#endregion
export { setToEntries };

View file

@ -0,0 +1,54 @@
//#region src/compat/_internal/tags.ts
const regexpTag = "[object RegExp]";
const stringTag = "[object String]";
const numberTag = "[object Number]";
const booleanTag = "[object Boolean]";
const argumentsTag = "[object Arguments]";
const symbolTag = "[object Symbol]";
const dateTag = "[object Date]";
const mapTag = "[object Map]";
const setTag = "[object Set]";
const arrayTag = "[object Array]";
const functionTag = "[object Function]";
const arrayBufferTag = "[object ArrayBuffer]";
const objectTag = "[object Object]";
const errorTag = "[object Error]";
const dataViewTag = "[object DataView]";
const uint8ArrayTag = "[object Uint8Array]";
const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
const uint16ArrayTag = "[object Uint16Array]";
const uint32ArrayTag = "[object Uint32Array]";
const bigUint64ArrayTag = "[object BigUint64Array]";
const int8ArrayTag = "[object Int8Array]";
const int16ArrayTag = "[object Int16Array]";
const int32ArrayTag = "[object Int32Array]";
const bigInt64ArrayTag = "[object BigInt64Array]";
const float32ArrayTag = "[object Float32Array]";
const float64ArrayTag = "[object Float64Array]";
//#endregion
exports.argumentsTag = argumentsTag;
exports.arrayBufferTag = arrayBufferTag;
exports.arrayTag = arrayTag;
exports.bigInt64ArrayTag = bigInt64ArrayTag;
exports.bigUint64ArrayTag = bigUint64ArrayTag;
exports.booleanTag = booleanTag;
exports.dataViewTag = dataViewTag;
exports.dateTag = dateTag;
exports.errorTag = errorTag;
exports.float32ArrayTag = float32ArrayTag;
exports.float64ArrayTag = float64ArrayTag;
exports.functionTag = functionTag;
exports.int16ArrayTag = int16ArrayTag;
exports.int32ArrayTag = int32ArrayTag;
exports.int8ArrayTag = int8ArrayTag;
exports.mapTag = mapTag;
exports.numberTag = numberTag;
exports.objectTag = objectTag;
exports.regexpTag = regexpTag;
exports.setTag = setTag;
exports.stringTag = stringTag;
exports.symbolTag = symbolTag;
exports.uint16ArrayTag = uint16ArrayTag;
exports.uint32ArrayTag = uint32ArrayTag;
exports.uint8ArrayTag = uint8ArrayTag;
exports.uint8ClampedArrayTag = uint8ClampedArrayTag;

View file

@ -0,0 +1,29 @@
//#region src/compat/_internal/tags.ts
const regexpTag = "[object RegExp]";
const stringTag = "[object String]";
const numberTag = "[object Number]";
const booleanTag = "[object Boolean]";
const argumentsTag = "[object Arguments]";
const symbolTag = "[object Symbol]";
const dateTag = "[object Date]";
const mapTag = "[object Map]";
const setTag = "[object Set]";
const arrayTag = "[object Array]";
const functionTag = "[object Function]";
const arrayBufferTag = "[object ArrayBuffer]";
const objectTag = "[object Object]";
const errorTag = "[object Error]";
const dataViewTag = "[object DataView]";
const uint8ArrayTag = "[object Uint8Array]";
const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
const uint16ArrayTag = "[object Uint16Array]";
const uint32ArrayTag = "[object Uint32Array]";
const bigUint64ArrayTag = "[object BigUint64Array]";
const int8ArrayTag = "[object Int8Array]";
const int16ArrayTag = "[object Int16Array]";
const int32ArrayTag = "[object Int32Array]";
const bigInt64ArrayTag = "[object BigInt64Array]";
const float32ArrayTag = "[object Float32Array]";
const float64ArrayTag = "[object Float64Array]";
//#endregion
export { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };

Some files were not shown because too many files have changed in this diff Show more