main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

1
node_modules/fast-equals/dist/min/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
import type { ComparatorConfig, CreateState, CustomEqualCreatorOptions, EqualityComparator, InternalEqualityComparator } from './internalTypes';
interface CreateIsEqualOptions<Meta> {
circular: boolean;
comparator: EqualityComparator<Meta>;
createState: CreateState<Meta> | undefined;
equals: InternalEqualityComparator<Meta>;
strict: boolean;
}
/**
* Create a comparator method based on the type-specific equality comparators passed.
*/
export declare function createEqualityComparator<Meta>({ areArraysEqual, areDatesEqual, areMapsEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
/**
* Create the configuration object used for building comparators.
*/
export declare function createEqualityComparatorConfig<Meta>({ circular, createCustomConfig, strict, }: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta>;
/**
* Default equality comparator pass-through, used as the standard `isEqual` creator for
* use inside the built comparator.
*/
export declare function createInternalEqualityComparator<Meta>(compare: EqualityComparator<Meta>): InternalEqualityComparator<Meta>;
/**
* Create the `isEqual` function used by the consuming application.
*/
export declare function createIsEqual<Meta>({ circular, comparator, createState, equals, strict, }: CreateIsEqualOptions<Meta>): <A, B>(a: A, b: B) => boolean;
export {};

37
node_modules/fast-equals/dist/min/types/equals.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes';
/**
* Whether the arrays are equal in value.
*/
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
/**
* Whether the dates passed are equal in value.
*/
export declare function areDatesEqual(a: Date, b: Date): boolean;
/**
* Whether the `Map`s are equal in value.
*/
export declare function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean;
/**
* Whether the objects are equal in value.
*/
export declare function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean;
/**
* Whether the objects are equal in value with strict property checking.
*/
export declare function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean;
/**
* Whether the primitive wrappers passed are equal in value.
*/
export declare function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean;
/**
* Whether the regexps passed are equal in value.
*/
export declare function areRegExpsEqual(a: RegExp, b: RegExp): boolean;
/**
* Whether the `Set`s are equal in value.
*/
export declare function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean;
/**
* Whether the TypedArray instances are equal in value.
*/
export declare function areTypedArraysEqual(a: TypedArray, b: TypedArray): boolean;

47
node_modules/fast-equals/dist/min/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
import type { CustomEqualCreatorOptions } from './internalTypes';
import { sameValueZeroEqual } from './utils';
export { sameValueZeroEqual };
export * from './internalTypes';
/**
* Whether the items passed are deeply-equal in value.
*/
export declare const deepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are deeply-equal in value based on strict comparison.
*/
export declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are deeply-equal in value, including circular references.
*/
export declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are deeply-equal in value, including circular references,
* based on strict comparison.
*/
export declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value.
*/
export declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value based on strict comparison
*/
export declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value, including circular references.
*/
export declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value, including circular references,
* based on strict comparison.
*/
export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Create a custom equality comparison method.
*
* This can be done to create very targeted comparisons in extreme hot-path scenarios
* where the standard methods are not performant enough, but can also be used to provide
* support for legacy environments that do not support expected features like
* `RegExp.prototype.flags` out of the box.
*/
export declare function createCustomEqual<Meta = undefined>(options?: CustomEqualCreatorOptions<Meta>): <A, B>(a: A, b: B) => boolean;

View File

@@ -0,0 +1,134 @@
/**
* Cache used to store references to objects, used for circular
* reference checks.
*/
export interface Cache<Key extends object, Value> {
delete(key: Key): boolean;
get(key: Key): Value | undefined;
set(key: Key, value: any): any;
}
export interface State<Meta> {
/**
* Cache used to identify circular references
*/
readonly cache: Cache<any, any> | undefined;
/**
* Method used to determine equality of nested value.
*/
readonly equals: InternalEqualityComparator<Meta>;
/**
* Additional value that can be used for comparisons.
*/
meta: Meta;
/**
* Whether the equality comparison is strict, meaning it matches
* all properties (including symbols and non-enumerable properties)
* with equal shape of descriptors.
*/
readonly strict: boolean;
}
export interface CircularState<Meta> extends State<Meta> {
readonly cache: Cache<any, any>;
}
export interface DefaultState<Meta> extends State<Meta> {
readonly cache: undefined;
}
export interface Dictionary<Value = any> {
[key: string | symbol]: Value;
$$typeof?: any;
}
export interface ComparatorConfig<Meta> {
/**
* Whether the arrays passed are equal in value. In strict mode, this includes
* additional properties added to the array.
*/
areArraysEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the dates passed are equal in value.
*/
areDatesEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the maps passed are equal in value. In strict mode, this includes
* additional properties added to the map.
*/
areMapsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the objects passed are equal in value. In strict mode, this includes
* non-enumerable properties added to the map, as well as symbol properties.
*/
areObjectsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the primitive wrappers passed are equal in value.
*/
arePrimitiveWrappersEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the regexps passed are equal in value.
*/
areRegExpsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the sets passed are equal in value. In strict mode, this includes
* additional properties added to the set.
*/
areSetsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the typed arrays passed are equal in value. In strict mode, this includes
* additional properties added to the typed array.
*/
areTypedArraysEqual: TypeEqualityComparator<any, Meta>;
}
export type CreateCustomComparatorConfig<Meta> = (config: ComparatorConfig<Meta>) => Partial<ComparatorConfig<Meta>>;
export type CreateState<Meta> = () => {
cache?: Cache<any, any> | undefined;
meta?: Meta;
};
export type EqualityComparator<Meta> = <A, B>(a: A, b: B, state: State<Meta>) => boolean;
export type AnyEqualityComparator<Meta> = (a: any, b: any, state: State<Meta>) => boolean;
export type EqualityComparatorCreator<Meta> = (fn: EqualityComparator<Meta>) => InternalEqualityComparator<Meta>;
export type InternalEqualityComparator<Meta> = (a: any, b: any, indexOrKeyA: any, indexOrKeyB: any, parentA: any, parentB: any, state: State<Meta>) => boolean;
export type PrimitiveWrapper = Boolean | Number | String;
/**
* Type which encompasses possible instances of TypedArray
* classes.
*
* **NOTE**: This does not include `BigInt64Array` and
* `BitUint64Array` because those are part of ES2020 and
* not supported by certain TS configurations. If using
* either in `areTypedArraysEqual`, you can cast the
* instance as `TypedArray` and it will work as expected,
* because runtime checks will still work for those classes.
*/
export type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint16Array | Uint32Array | Uint8Array | Uint8ClampedArray;
export type TypeEqualityComparator<Type, Meta = undefined> = (a: Type, b: Type, state: State<Meta>) => boolean;
export interface CustomEqualCreatorOptions<Meta> {
/**
* Whether circular references should be supported. It causes the
* comparison to be slower, but for objects that have circular references
* it is required to avoid stack overflows.
*/
circular?: boolean;
/**
* Create a custom configuration of type-specific equality comparators.
* This receives the default configuration, which allows either replacement
* or supersetting of the default methods.
*/
createCustomConfig?: CreateCustomComparatorConfig<Meta>;
/**
* Create a custom internal comparator, which is used as an override to the
* default entry point for nested value equality comparisons. This is often
* used for doing custom logic for specific types (such as handling a specific
* class instance differently than other objects) or to incorporate `meta` in
* the comparison. See the recipes for examples.
*/
createInternalComparator?: (compare: EqualityComparator<Meta>) => InternalEqualityComparator<Meta>;
/**
* Create a custom `state` object passed between the methods. This allows for
* custom `cache` and/or `meta` values to be used.
*/
createState?: CreateState<Meta>;
/**
* Whether the equality comparison is strict, meaning it matches
* all properties (including symbols and non-enumerable properties)
* with equal shape of descriptors.
*/
strict?: boolean;
}

24
node_modules/fast-equals/dist/min/types/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes';
/**
* Combine two comparators into a single comparators.
*/
export declare function combineComparators<Meta>(comparatorA: AnyEqualityComparator<Meta>, comparatorB: AnyEqualityComparator<Meta>): <A, B>(a: A, b: B, state: State<Meta>) => boolean;
/**
* Wrap the provided `areItemsEqual` method to manage the circular state, allowing
* for circular references to be safely included in the comparison without creating
* stack overflows.
*/
export declare function createIsCircular<AreItemsEqual extends TypeEqualityComparator<any, any>>(areItemsEqual: AreItemsEqual): AreItemsEqual;
/**
* Get the properties to strictly examine, which include both own properties that are
* not enumerable and symbol properties.
*/
export declare function getStrictProperties(object: Dictionary): Array<string | symbol>;
/**
* Whether the object contains the property passed as an own property.
*/
export declare const hasOwn: (o: object, v: PropertyKey) => boolean;
/**
* Whether the values passed are strictly equal or both NaN.
*/
export declare function sameValueZeroEqual(a: any, b: any): boolean;