v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

21
frontend/node_modules/fast-equals/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Tony Quetano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

477
frontend/node_modules/fast-equals/README.md generated vendored Normal file
View File

@ -0,0 +1,477 @@
# fast-equals
<img src="https://img.shields.io/badge/build-passing-brightgreen.svg"/>
<img src="https://img.shields.io/badge/coverage-100%25-brightgreen.svg"/>
<img src="https://img.shields.io/badge/license-MIT-blue.svg"/>
Perform [blazing fast](#benchmarks) equality comparisons (either deep or shallow) on two objects passed, while also
maintaining a high degree of flexibility for various implementation use-cases. It has no dependencies, and is ~2kB when
minified and gzipped.
The following types are handled out-of-the-box:
- Plain objects (including `react` elements and `Arguments`)
- Arrays
- `ArrayBuffer` / `TypedArray` / `DataView` instances
- `Date` objects
- `RegExp` objects
- `Map` / `Set` iterables
- `Promise` objects
- Primitive wrappers (`new Boolean()` / `new Number()` / `new String()`)
- Custom class instances, including subclasses of native classes
Methods are available for deep, shallow, or referential equality comparison. In addition, you can opt into support for
circular objects, or performing a "strict" comparison with unconventional property definition, or both. You can also
customize any specific type comparison based on your application's use-cases.
## Table of contents
- [fast-equals](#fast-equals)
- [Table of contents](#table-of-contents)
- [Usage](#usage)
- [Specific builds](#specific-builds)
- [Available methods](#available-methods)
- [deepEqual](#deepequal)
- [Comparing `Map`s](#comparing-maps)
- [shallowEqual](#shallowequal)
- [sameValueZeroEqual](#samevaluezeroequal)
- [circularDeepEqual](#circulardeepequal)
- [circularShallowEqual](#circularshallowequal)
- [strictDeepEqual](#strictdeepequal)
- [strictShallowEqual](#strictshallowequal)
- [strictCircularDeepEqual](#strictcirculardeepequal)
- [strictCircularShallowEqual](#strictcircularshallowequal)
- [createCustomEqual](#createcustomequal)
- [unknownTagComparators](#unknowntagcomparators)
- [Recipes](#recipes)
- [Benchmarks](#benchmarks)
- [Development](#development)
## Usage
```ts
import { deepEqual } from 'fast-equals';
console.log(deepEqual({ foo: 'bar' }, { foo: 'bar' })); // true
```
### Specific builds
By default, npm should resolve the correct build of the package based on your consumption (ESM vs CommonJS). However, if
you want to force use of a specific build, they can be located here:
- ESM => `fast-equals/dist/esm/index.mjs`
- CommonJS => `fast-equals/dist/cjs/index.cjs`
- UMD => `fast-equals/dist/umd/index.js`
- Minified UMD => `fast-equals/dist/min/index.js`
If you are having issues loading a specific build type,
[please file an issue](https://github.com/planttheidea/fast-equals/issues).
## Available methods
### deepEqual
Performs a deep equality comparison on the two objects passed and returns a boolean representing the value equivalency
of the objects.
```ts
import { deepEqual } from 'fast-equals';
const objectA = { foo: { bar: 'baz' } };
const objectB = { foo: { bar: 'baz' } };
console.log(objectA === objectB); // false
console.log(deepEqual(objectA, objectB)); // true
```
#### Comparing `Map`s
`Map` objects support complex keys (objects, Arrays, etc.), however
[the spec for key lookups in `Map` are based on `SameZeroValue`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#key_equality).
If the spec were followed for comparison, the following would always be `false`:
```ts
const mapA = new Map([[{ foo: 'bar' }, { baz: 'quz' }]]);
const mapB = new Map([[{ foo: 'bar' }, { baz: 'quz' }]]);
deepEqual(mapA, mapB);
```
To support true deep equality of all contents, `fast-equals` will perform a deep equality comparison for key and value
parirs. Therefore, the above would be `true`.
### shallowEqual
Performs a shallow equality comparison on the two objects passed and returns a boolean representing the value
equivalency of the objects.
```ts
import { shallowEqual } from 'fast-equals';
const nestedObject = { bar: 'baz' };
const objectA = { foo: nestedObject };
const objectB = { foo: nestedObject };
const objectC = { foo: { bar: 'baz' } };
console.log(objectA === objectB); // false
console.log(shallowEqual(objectA, objectB)); // true
console.log(shallowEqual(objectA, objectC)); // false
```
### sameValueZeroEqual
Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) comparison on the two
objects passed and returns a boolean representing the value equivalency of the objects. In simple terms, this means
either strictly equal or both `NaN`.
```ts
import { sameValueZeroEqual } from 'fast-equals';
const mainObject = { foo: NaN, bar: 'baz' };
const objectA = 'baz';
const objectB = NaN;
const objectC = { foo: NaN, bar: 'baz' };
console.log(sameValueZeroEqual(mainObject.bar, objectA)); // true
console.log(sameValueZeroEqual(mainObject.foo, objectB)); // true
console.log(sameValueZeroEqual(mainObject, objectC)); // false
```
### circularDeepEqual
Performs the same comparison as `deepEqual` but supports circular objects. It is slower than `deepEqual`, so only use if
you know circular objects are present.
```ts
function Circular(value) {
this.me = {
deeply: {
nested: {
reference: this,
},
},
value,
};
}
console.log(circularDeepEqual(new Circular('foo'), new Circular('foo'))); // true
console.log(circularDeepEqual(new Circular('foo'), new Circular('bar'))); // false
```
Just as with `deepEqual`, [both keys and values are compared for deep equality](#comparing-maps).
### circularShallowEqual
Performs the same comparison as `shallowequal` but supports circular objects. It is slower than `shallowEqual`, so only
use if you know circular objects are present.
```ts
const array = ['foo'];
array.push(array);
console.log(circularShallowEqual(array, ['foo', array])); // true
console.log(circularShallowEqual(array, [array])); // false
```
### strictDeepEqual
Performs the same comparison as `deepEqual` but performs a strict comparison of the objects. In this includes:
- Checking symbol properties
- Checking non-enumerable properties in object comparisons
- Checking full descriptor of properties on the object to match
- Checking non-index properties on arrays
- Checking non-key properties on `Map` / `Set` objects
```ts
const array = [{ foo: 'bar' }];
const otherArray = [{ foo: 'bar' }];
array.bar = 'baz';
otherArray.bar = 'baz';
console.log(strictDeepEqual(array, otherArray)); // true;
console.log(strictDeepEqual(array, [{ foo: 'bar' }])); // false;
```
### strictShallowEqual
Performs the same comparison as `shallowEqual` but performs a strict comparison of the objects. In this includes:
- Checking non-enumerable properties in object comparisons
- Checking full descriptor of properties on the object to match
- Checking non-index properties on arrays
- Checking non-key properties on `Map` / `Set` objects
```ts
const array = ['foo'];
const otherArray = ['foo'];
array.bar = 'baz';
otherArray.bar = 'baz';
console.log(strictDeepEqual(array, otherArray)); // true;
console.log(strictDeepEqual(array, ['foo'])); // false;
```
### strictCircularDeepEqual
Performs the same comparison as `circularDeepEqual` but performs a strict comparison of the objects. In this includes:
- Checking `Symbol` properties on the object
- Checking non-enumerable properties in object comparisons
- Checking full descriptor of properties on the object to match
- Checking non-index properties on arrays
- Checking non-key properties on `Map` / `Set` objects
```ts
function Circular(value) {
this.me = {
deeply: {
nested: {
reference: this,
},
},
value,
};
}
const first = new Circular('foo');
Object.defineProperty(first, 'bar', {
enumerable: false,
value: 'baz',
});
const second = new Circular('foo');
Object.defineProperty(second, 'bar', {
enumerable: false,
value: 'baz',
});
console.log(circularDeepEqual(first, second)); // true
console.log(circularDeepEqual(first, new Circular('foo'))); // false
```
### strictCircularShallowEqual
Performs the same comparison as `circularShallowEqual` but performs a strict comparison of the objects. In this
includes:
- Checking non-enumerable properties in object comparisons
- Checking full descriptor of properties on the object to match
- Checking non-index properties on arrays
- Checking non-key properties on `Map` / `Set` objects
```ts
const array = ['foo'];
const otherArray = ['foo'];
array.push(array);
otherArray.push(otherArray);
array.bar = 'baz';
otherArray.bar = 'baz';
console.log(circularShallowEqual(array, otherArray)); // true
console.log(circularShallowEqual(array, ['foo', array])); // false
```
### createCustomEqual
Creates a custom equality comparator that will be used on nested values in the object. Unlike `deepEqual` and
`shallowEqual`, this is a factory method that receives the default options used internally, and allows you to override
the defaults as needed. This is generally for extreme edge-cases, or supporting legacy environments.
The signature is as follows:
```ts
interface Cache<Key extends object, Value> {
delete(key: Key): boolean;
get(key: Key): Value | undefined;
set(key: Key, value: any): any;
}
interface ComparatorConfig<Meta> {
areArraysEqual: TypeEqualityComparator<any[], Meta>;
areDatesEqual: TypeEqualityComparator<Date, Meta>;
areErrorsEqual: TypeEqualityComparator<Error, Meta>;
areFunctionsEqual: TypeEqualityComparator<(...args: any[]) => any, Meta>;
areMapsEqual: TypeEqualityComparator<Map<any, any>, Meta>;
areObjectsEqual: TypeEqualityComparator<Record<string, any>, Meta>;
arePrimitiveWrappersEqual: TypeEqualityComparator<boolean | string | number, Meta>;
areRegExpsEqual: TypeEqualityComparator<RegExp, Meta>;
areSetsEqual: TypeEqualityComparator<Set<any>, Meta>;
areTypedArraysEqual: TypeEqualityComparator<TypedArray, Meta>;
areUrlsEqual: TypeEqualityComparator<URL, Meta>;
unknownTagComparators: Record<string, TypeEqualityComparator<string, any>>;
}
function createCustomEqual<Meta>(options: {
circular?: boolean;
createCustomConfig?: (defaultConfig: ComparatorConfig<Meta>) => Partial<ComparatorConfig<Meta>>;
createInternalComparator?: (
compare: <A, B>(a: A, b: B, state: State<Meta>) => boolean,
) => (a: any, b: any, indexOrKeyA: any, indexOrKeyB: any, parentA: any, parentB: any, state: State<Meta>) => boolean;
createState?: () => { cache?: Cache; meta?: Meta };
strict?: boolean;
}): <A, B>(a: A, b: B) => boolean;
```
Create a custom equality comparator. This allows complete control over building a bespoke equality method, in case your
use-case requires a higher degree of performance, legacy environment support, or any other non-standard usage. The
[recipes](#recipes) provide examples of use in different use-cases, but if you have a specific goal in mind and would
like assistance feel free to [file an issue](https://github.com/planttheidea/fast-equals/issues).
_**NOTE**: `Map` implementations compare equality for both keys and value. When using a custom comparator and comparing
equality of the keys, the iteration index is provided as both `indexOrKeyA` and `indexOrKeyB` to help use-cases where
ordering of keys matters to equality._
#### unknownTagComparators
If you want to compare objects that have a custom `@@toStringTag`, you can provide a map of the custom tags you want to
support via the `unknownTagComparators` option. See [this recipe]('./recipes/special-objects.md) for an example.
#### Recipes
Some recipes have been created to provide examples of use-cases for `createCustomEqual`. Even if not directly applicable
to the problem you are solving, they can offer guidance of how to structure your solution.
- [Legacy environment support for `RegExp` comparators](./recipes/legacy-regexp-support.md)
- [Explicit property check](./recipes/explicit-property-check.md)
- [Using `meta` in comparison](./recipes//using-meta-in-comparison.md)
- [Comparing non-standard properties](./recipes/non-standard-properties.md)
- [Strict property descriptor comparison](./recipes/strict-property-descriptor-check.md)
- [Legacy environment support for circualr equal comparators](./recipes/legacy-circular-equal-support.md)
- [Custom `@@toStringTag` support](./recipes/special-objects.md)
## Benchmarks
All benchmarks were performed on an i9-11900H Ubuntu Linux 24.04 laptop with 64GB of memory using NodeJS version
`20.17.0`, and are based on averages of running comparisons based deep equality on the following object types:
- Primitives (`String`, `Number`, `null`, `undefined`)
- `Function`
- `Object`
- `Array`
- `Date`
- `RegExp`
- `react` elements
- A mixed object with a combination of all the above types
```bash
Testing mixed objects equal...
┌────────────────────────────────────────┬────────────────┐
│ Name │ Ops / sec │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (passed) │ 1416193.769468 │
├────────────────────────────────────────┼────────────────┤
│ fast-deep-equal (passed) │ 1284824.583215 │
├────────────────────────────────────────┼────────────────┤
│ react-fast-compare (passed) │ 1246947.505444 │
├────────────────────────────────────────┼────────────────┤
│ shallow-equal-fuzzy (passed) │ 1238082.379207 │
├────────────────────────────────────────┼────────────────┤
│ nano-equal (failed) │ 946782.33704 │
├────────────────────────────────────────┼────────────────┤
│ dequal/lite (passed) │ 758213.632866 │
├────────────────────────────────────────┼────────────────┤
│ dequal (passed) │ 756789.655029 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (circular) (passed) │ 726093.253185 │
├────────────────────────────────────────┼────────────────┤
│ underscore.isEqual (passed) │ 489748.701783 │
├────────────────────────────────────────┼────────────────┤
│ assert.deepStrictEqual (passed) │ 453761.890107 │
├────────────────────────────────────────┼────────────────┤
│ lodash.isEqual (passed) │ 288264.867811 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (strict) (passed) │ 217221.619705 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (strict circular) (passed) │ 186916.942934 │
├────────────────────────────────────────┼────────────────┤
│ deep-eql (passed) │ 162487.877883 │
├────────────────────────────────────────┼────────────────┤
│ deep-equal (passed) │ 916.680714 │
└────────────────────────────────────────┴────────────────┘
Testing mixed objects not equal...
┌────────────────────────────────────────┬────────────────┐
│ Name │ Ops / sec │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (passed) │ 4687012.640614 │
├────────────────────────────────────────┼────────────────┤
│ fast-deep-equal (passed) │ 3418170.156109 │
├────────────────────────────────────────┼────────────────┤
│ react-fast-compare (passed) │ 3283516.669966 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (circular) (passed) │ 3268062.099602 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (strict) (passed) │ 1747578.66456 │
├────────────────────────────────────────┼────────────────┤
│ fast-equals (strict circular) (passed) │ 1477873.624956 │
├────────────────────────────────────────┼────────────────┤
│ dequal/lite (passed) │ 1335397.839502 │
├────────────────────────────────────────┼────────────────┤
│ dequal (passed) │ 1319426.71146 │
├────────────────────────────────────────┼────────────────┤
│ shallow-equal-fuzzy (failed) │ 1237432.986615 │
├────────────────────────────────────────┼────────────────┤
│ nano-equal (passed) │ 1064383.319776 │
├────────────────────────────────────────┼────────────────┤
│ underscore.isEqual (passed) │ 920462.516736 │
├────────────────────────────────────────┼────────────────┤
│ lodash.isEqual (passed) │ 379370.998021 │
├────────────────────────────────────────┼────────────────┤
│ deep-eql (passed) │ 184111.383127 │
├────────────────────────────────────────┼────────────────┤
│ assert.deepStrictEqual (passed) │ 20775.59065 │
├────────────────────────────────────────┼────────────────┤
│ deep-equal (passed) │ 3678.51009 │
└────────────────────────────────────────┴────────────────┘
```
Caveats that impact the benchmark (and accuracy of comparison):
- `Map`s, `Promise`s, and `Set`s were excluded from the benchmark entirely because no library other than `deep-eql`
fully supported their comparison
- `fast-deep-equal`, `react-fast-compare` and `nano-equal` throw on objects with `null` as prototype
(`Object.create(null)`)
- `assert.deepStrictEqual` does not support `NaN` or `SameValueZero` equality for dates
- `deep-eql` does not support `SameValueZero` equality for zero equality (positive and negative zero are not equal)
- `deep-equal` does not support `NaN` and does not strictly compare object type, or date / regexp values, nor uses
`SameValueZero` equality for dates
- `fast-deep-equal` does not support `NaN` or `SameValueZero` equality for dates
- `nano-equal` does not strictly compare object property structure, array length, or object type, nor `SameValueZero`
equality for dates
- `react-fast-compare` does not support `NaN` or `SameValueZero` equality for dates, and does not compare `function`
equality
- `shallow-equal-fuzzy` does not strictly compare object type or regexp values, nor `SameValueZero` equality for dates
- `underscore.isEqual` does not support `SameValueZero` equality for primitives or dates
All of these have the potential of inflating the respective library's numbers in comparison to `fast-equals`, but it was
the closest apples-to-apples comparison I could create of a reasonable sample size. It should be noted that `react`
elements can be circular objects, however simple elements are not; I kept the `react` comparison very basic to allow it
to be included.
## Development
Standard practice, clone the repo and `npm i` to get the dependencies. The following npm scripts are available:
- benchmark => run benchmark tests against other equality libraries
- build => build `main`, `module`, and `browser` distributables with `rollup`
- clean => run `rimraf` on the `dist` folder
- dev => start `vite` playground App
- dist => run `build`
- lint => run ESLint on all files in `src` folder (also runs on `dev` script)
- lint:fix => run `lint` script, but with auto-fixer
- prepublish:compile => run `lint`, `test:coverage`, `transpile:lib`, `transpile:es`, and `dist` scripts
- start => run `dev`
- test => run AVA with NODE_ENV=test on all files in `test` folder
- test:coverage => run same script as `test` with code coverage calculation via `nyc`
- test:watch => run same script as `test` but keep persistent watcher

View File

@ -0,0 +1,60 @@
import type {
ComparatorConfig,
CreateState,
CustomEqualCreatorOptions,
EqualityComparator,
InternalEqualityComparator,
} from './internalTypes.d.cts';
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>({
areArrayBuffersEqual,
areArraysEqual,
areDataViewsEqual,
areDatesEqual,
areErrorsEqual,
areFunctionsEqual,
areMapsEqual,
areNumbersEqual,
areObjectsEqual,
arePrimitiveWrappersEqual,
areRegExpsEqual,
areSetsEqual,
areTypedArraysEqual,
areUrlsEqual,
unknownTagComparators,
}: 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 {};

View File

@ -0,0 +1,62 @@
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.d.cts';
import type { sameValueZeroEqual } from './utils.d.cts';
/**
* Whether the array buffers are equal in value.
*/
export declare function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean;
/**
* Whether the arrays are equal in value.
*/
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
/**
* Whether the dataviews are equal in value.
*/
export declare function areDataViewsEqual(a: DataView, b: DataView): boolean;
/**
* Whether the dates passed are equal in value.
*/
export declare function areDatesEqual(a: Date, b: Date): boolean;
/**
* Whether the errors passed are equal in value.
*/
export declare function areErrorsEqual(a: Error, b: Error): boolean;
/**
* Whether the functions passed are equal in value.
*/
export declare function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): 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 numbers are equal in value.
*/
export declare const areNumbersEqual: typeof sameValueZeroEqual;
/**
* 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;
/**
* Whether the URL instances are equal in value.
*/
export declare function areUrlsEqual(a: URL, b: URL): boolean;

653
frontend/node_modules/fast-equals/dist/cjs/index.cjs generated vendored Normal file
View File

@ -0,0 +1,653 @@
'use strict';
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
// eslint-disable-next-line @typescript-eslint/unbound-method
const { hasOwnProperty } = Object.prototype;
/**
* Combine two comparators into a single comparators.
*/
function combineComparators(comparatorA, comparatorB) {
return function isEqual(a, b, state) {
return comparatorA(a, b, state) && comparatorB(a, b, state);
};
}
/**
* 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.
*/
function createIsCircular(areItemsEqual) {
return function isCircular(a, b, state) {
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
return areItemsEqual(a, b, state);
}
const { cache } = state;
const cachedA = cache.get(a);
const cachedB = cache.get(b);
if (cachedA && cachedB) {
return cachedA === b && cachedB === a;
}
cache.set(a, b);
cache.set(b, a);
const result = areItemsEqual(a, b, state);
cache.delete(a);
cache.delete(b);
return result;
};
}
/**
* Get the `@@toStringTag` of the value, if it exists.
*/
function getShortTag(value) {
return value != null ? value[Symbol.toStringTag] : undefined;
}
/**
* Get the properties to strictly examine, which include both own properties that are
* not enumerable and symbol properties.
*/
function getStrictProperties(object) {
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
}
/**
* Whether the object contains the property passed as an own property.
*/
const hasOwn =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
/**
* Whether the values passed are strictly equal or both NaN.
*/
function sameValueZeroEqual(a, b) {
return a === b || (!a && !b && a !== a && b !== b);
}
const PREACT_VNODE = '__v';
const PREACT_OWNER = '__o';
const REACT_OWNER = '_owner';
const { getOwnPropertyDescriptor, keys } = Object;
/**
* Whether the array buffers are equal in value.
*/
function areArrayBuffersEqual(a, b) {
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
}
/**
* Whether the arrays are equal in value.
*/
function areArraysEqual(a, b, state) {
let index = a.length;
if (b.length !== index) {
return false;
}
while (index-- > 0) {
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
return false;
}
}
return true;
}
/**
* Whether the dataviews are equal in value.
*/
function areDataViewsEqual(a, b) {
return (a.byteLength === b.byteLength
&& areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));
}
/**
* Whether the dates passed are equal in value.
*/
function areDatesEqual(a, b) {
return sameValueZeroEqual(a.getTime(), b.getTime());
}
/**
* Whether the errors passed are equal in value.
*/
function areErrorsEqual(a, b) {
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
}
/**
* Whether the functions passed are equal in value.
*/
function areFunctionsEqual(a, b) {
return a === b;
}
/**
* Whether the `Map`s are equal in value.
*/
function areMapsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.entries();
let aResult;
let bResult;
let index = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.entries();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (matchedIndices[matchIndex]) {
matchIndex++;
continue;
}
const aEntry = aResult.value;
const bEntry = bResult.value;
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
&& state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
index++;
}
return true;
}
/**
* Whether the numbers are equal in value.
*/
const areNumbersEqual = sameValueZeroEqual;
/**
* Whether the objects are equal in value.
*/
function areObjectsEqual(a, b, state) {
const properties = keys(a);
let index = properties.length;
if (keys(b).length !== index) {
return false;
}
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
if (!isPropertyEqual(a, b, state, properties[index])) {
return false;
}
}
return true;
}
/**
* Whether the objects are equal in value with strict property checking.
*/
function areObjectsEqualStrict(a, b, state) {
const properties = getStrictProperties(a);
let index = properties.length;
if (getStrictProperties(b).length !== index) {
return false;
}
let property;
let descriptorA;
let descriptorB;
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
property = properties[index];
if (!isPropertyEqual(a, b, state, property)) {
return false;
}
descriptorA = getOwnPropertyDescriptor(a, property);
descriptorB = getOwnPropertyDescriptor(b, property);
if ((descriptorA || descriptorB)
&& (!descriptorA
|| !descriptorB
|| descriptorA.configurable !== descriptorB.configurable
|| descriptorA.enumerable !== descriptorB.enumerable
|| descriptorA.writable !== descriptorB.writable)) {
return false;
}
}
return true;
}
/**
* Whether the primitive wrappers passed are equal in value.
*/
function arePrimitiveWrappersEqual(a, b) {
return sameValueZeroEqual(a.valueOf(), b.valueOf());
}
/**
* Whether the regexps passed are equal in value.
*/
function areRegExpsEqual(a, b) {
return a.source === b.source && a.flags === b.flags;
}
/**
* Whether the `Set`s are equal in value.
*/
function areSetsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.values();
let aResult;
let bResult;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.values();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (!matchedIndices[matchIndex]
&& state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
}
return true;
}
/**
* Whether the TypedArray instances are equal in value.
*/
function areTypedArraysEqual(a, b) {
let index = a.byteLength;
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
return false;
}
while (index-- > 0) {
if (a[index] !== b[index]) {
return false;
}
}
return true;
}
/**
* Whether the URL instances are equal in value.
*/
function areUrlsEqual(a, b) {
return (a.hostname === b.hostname
&& a.pathname === b.pathname
&& a.protocol === b.protocol
&& a.port === b.port
&& a.hash === b.hash
&& a.username === b.username
&& a.password === b.password);
}
function isPropertyEqual(a, b, state, property) {
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
&& (a.$$typeof || b.$$typeof)) {
return true;
}
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
}
const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
const ARGUMENTS_TAG = '[object Arguments]';
const BOOLEAN_TAG = '[object Boolean]';
const DATA_VIEW_TAG = '[object DataView]';
const DATE_TAG = '[object Date]';
const ERROR_TAG = '[object Error]';
const MAP_TAG = '[object Map]';
const NUMBER_TAG = '[object Number]';
const OBJECT_TAG = '[object Object]';
const REG_EXP_TAG = '[object RegExp]';
const SET_TAG = '[object Set]';
const STRING_TAG = '[object String]';
const TYPED_ARRAY_TAGS = {
'[object Int8Array]': true,
'[object Uint8Array]': true,
'[object Uint8ClampedArray]': true,
'[object Int16Array]': true,
'[object Uint16Array]': true,
'[object Int32Array]': true,
'[object Uint32Array]': true,
'[object Float16Array]': true,
'[object Float32Array]': true,
'[object Float64Array]': true,
'[object BigInt64Array]': true,
'[object BigUint64Array]': true,
};
const URL_TAG = '[object URL]';
// eslint-disable-next-line @typescript-eslint/unbound-method
const toString = Object.prototype.toString;
/**
* Create a comparator method based on the type-specific equality comparators passed.
*/
function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
/**
* compare the value of the two objects and return true if they are equivalent in values
*/
return function comparator(a, b, state) {
// If the items are strictly equal, no need to do a value comparison.
if (a === b) {
return true;
}
// If either of the items are nullish and fail the strictly equal check
// above, then they must be unequal.
if (a == null || b == null) {
return false;
}
const type = typeof a;
if (type !== typeof b) {
return false;
}
if (type !== 'object') {
if (type === 'number') {
return areNumbersEqual(a, b, state);
}
if (type === 'function') {
return areFunctionsEqual(a, b, state);
}
// If a primitive value that is not strictly equal, it must be unequal.
return false;
}
const constructor = a.constructor;
// Checks are listed in order of commonality of use-case:
// 1. Common complex object types (plain object, array)
// 2. Common data values (date, regexp)
// 3. Less-common complex object types (map, set)
// 4. Less-common data values (promise, primitive wrappers)
// Inherently this is both subjective and assumptive, however
// when reviewing comparable libraries in the wild this order
// appears to be generally consistent.
// Constructors should match, otherwise there is potential for false positives
// between class and subclass or custom object and POJO.
if (constructor !== b.constructor) {
return false;
}
// `isPlainObject` only checks against the object's own realm. Cross-realm
// comparisons are rare, and will be handled in the ultimate fallback, so
// we can avoid capturing the string tag.
if (constructor === Object) {
return areObjectsEqual(a, b, state);
}
// `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
// the string tag or doing an `instanceof` check.
if (Array.isArray(a)) {
return areArraysEqual(a, b, state);
}
// Try to fast-path equality checks for other complex object types in the
// same realm to avoid capturing the string tag. Strict equality is used
// instead of `instanceof` because it is more performant for the common
// use-case. If someone is subclassing a native class, it will be handled
// with the string tag comparison.
if (constructor === Date) {
return areDatesEqual(a, b, state);
}
if (constructor === RegExp) {
return areRegExpsEqual(a, b, state);
}
if (constructor === Map) {
return areMapsEqual(a, b, state);
}
if (constructor === Set) {
return areSetsEqual(a, b, state);
}
// Since this is a custom object, capture the string tag to determing its type.
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
const tag = toString.call(a);
if (tag === DATE_TAG) {
return areDatesEqual(a, b, state);
}
// For RegExp, the properties are not enumerable, and therefore will give false positives if
// tested like a standard object.
if (tag === REG_EXP_TAG) {
return areRegExpsEqual(a, b, state);
}
if (tag === MAP_TAG) {
return areMapsEqual(a, b, state);
}
if (tag === SET_TAG) {
return areSetsEqual(a, b, state);
}
if (tag === OBJECT_TAG) {
// The exception for value comparison is custom `Promise`-like class instances. These should
// be treated the same as standard `Promise` objects, which means strict equality, and if
// it reaches this point then that strict equality comparison has already failed.
return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);
}
// If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === URL_TAG) {
return areUrlsEqual(a, b, state);
}
// If an error tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === ERROR_TAG) {
return areErrorsEqual(a, b, state);
}
// If an arguments tag, it should be treated as a standard object.
if (tag === ARGUMENTS_TAG) {
return areObjectsEqual(a, b, state);
}
if (TYPED_ARRAY_TAGS[tag]) {
return areTypedArraysEqual(a, b, state);
}
if (tag === ARRAY_BUFFER_TAG) {
return areArrayBuffersEqual(a, b, state);
}
if (tag === DATA_VIEW_TAG) {
return areDataViewsEqual(a, b, state);
}
// As the penultimate fallback, check if the values passed are primitive wrappers. This
// is very rare in modern JS, which is why it is deprioritized compared to all other object
// types.
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
return arePrimitiveWrappersEqual(a, b, state);
}
if (unknownTagComparators) {
let unknownTagComparator = unknownTagComparators[tag];
if (!unknownTagComparator) {
const shortTag = getShortTag(a);
if (shortTag) {
unknownTagComparator = unknownTagComparators[shortTag];
}
}
// If the custom config has an unknown tag comparator that matches the captured tag or the
// @@toStringTag, it is the source of truth for whether the values are equal.
if (unknownTagComparator) {
return unknownTagComparator(a, b, state);
}
}
// If not matching any tags that require a specific type of comparison, then we hard-code false because
// the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
// - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
// comparison that can be made.
// - For types that can be introspected, but rarely have requirements to be compared
// (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
// use-cases (may be included in a future release, if requested enough).
// - For types that can be introspected but do not have an objective definition of what
// equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
// In all cases, these decisions should be reevaluated based on changes to the language and
// common development practices.
return false;
};
}
/**
* Create the configuration object used for building comparators.
*/
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
let config = {
areArrayBuffersEqual,
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
areDataViewsEqual,
areDatesEqual: areDatesEqual,
areErrorsEqual: areErrorsEqual,
areFunctionsEqual: areFunctionsEqual,
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
areNumbersEqual: areNumbersEqual,
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
areRegExpsEqual: areRegExpsEqual,
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
areTypedArraysEqual: strict
? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
: areTypedArraysEqual,
areUrlsEqual: areUrlsEqual,
unknownTagComparators: undefined,
};
if (createCustomConfig) {
config = Object.assign({}, config, createCustomConfig(config));
}
if (circular) {
const areArraysEqual = createIsCircular(config.areArraysEqual);
const areMapsEqual = createIsCircular(config.areMapsEqual);
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
const areSetsEqual = createIsCircular(config.areSetsEqual);
config = Object.assign({}, config, {
areArraysEqual,
areMapsEqual,
areObjectsEqual,
areSetsEqual,
});
}
return config;
}
/**
* Default equality comparator pass-through, used as the standard `isEqual` creator for
* use inside the built comparator.
*/
function createInternalEqualityComparator(compare) {
return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
return compare(a, b, state);
};
}
/**
* Create the `isEqual` function used by the consuming application.
*/
function createIsEqual({ circular, comparator, createState, equals, strict }) {
if (createState) {
return function isEqual(a, b) {
const { cache = circular ? new WeakMap() : undefined, meta } = createState();
return comparator(a, b, {
cache,
equals,
meta,
strict,
});
};
}
if (circular) {
return function isEqual(a, b) {
return comparator(a, b, {
cache: new WeakMap(),
equals,
meta: undefined,
strict,
});
};
}
const state = {
cache: undefined,
equals,
meta: undefined,
strict,
};
return function isEqual(a, b) {
return comparator(a, b, state);
};
}
/**
* Whether the items passed are deeply-equal in value.
*/
const deepEqual = createCustomEqual();
/**
* Whether the items passed are deeply-equal in value based on strict comparison.
*/
const strictDeepEqual = createCustomEqual({ strict: true });
/**
* Whether the items passed are deeply-equal in value, including circular references.
*/
const circularDeepEqual = createCustomEqual({ circular: true });
/**
* Whether the items passed are deeply-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularDeepEqual = createCustomEqual({
circular: true,
strict: true,
});
/**
* Whether the items passed are shallowly-equal in value.
*/
const shallowEqual = createCustomEqual({
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value based on strict comparison
*/
const strictShallowEqual = createCustomEqual({
strict: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references.
*/
const circularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
strict: true,
});
/**
* 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.
*/
function createCustomEqual(options = {}) {
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;
const config = createEqualityComparatorConfig(options);
const comparator = createEqualityComparator(config);
const equals = createCustomInternalComparator
? createCustomInternalComparator(comparator)
: createInternalEqualityComparator(comparator);
return createIsEqual({ circular, comparator, createState, equals, strict });
}
exports.circularDeepEqual = circularDeepEqual;
exports.circularShallowEqual = circularShallowEqual;
exports.createCustomEqual = createCustomEqual;
exports.deepEqual = deepEqual;
exports.sameValueZeroEqual = sameValueZeroEqual;
exports.shallowEqual = shallowEqual;
exports.strictCircularDeepEqual = strictCircularDeepEqual;
exports.strictCircularShallowEqual = strictCircularShallowEqual;
exports.strictDeepEqual = strictDeepEqual;
exports.strictShallowEqual = strictShallowEqual;
//# sourceMappingURL=index.cjs.map

File diff suppressed because one or more lines are too long

66
frontend/node_modules/fast-equals/dist/cjs/index.d.cts generated vendored Normal file
View File

@ -0,0 +1,66 @@
import type { CustomEqualCreatorOptions } from './internalTypes.d.cts';
import type { sameValueZeroEqual } from './utils.d.cts';
export { sameValueZeroEqual };
export type {
AnyEqualityComparator,
Cache,
CircularState,
ComparatorConfig,
CreateCustomComparatorConfig,
CreateState,
CustomEqualCreatorOptions,
DefaultState,
Dictionary,
EqualityComparator,
EqualityComparatorCreator,
InternalEqualityComparator,
PrimitiveWrapper,
State,
TypeEqualityComparator,
TypedArray,
} from './internalTypes.d.cts';
/**
* 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,178 @@
/**
* 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 array buffers passed are equal in value. In strict mode, this includes
* additional properties added to the array.
*/
areArrayBuffersEqual: TypeEqualityComparator<any, 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 data views passed are equal in value.
*/
areDataViewsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the dates passed are equal in value.
*/
areDatesEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the errors passed are equal in value.
*/
areErrorsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the functions passed are equal in value.
*/
areFunctionsEqual: 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 numbers passed are equal in value.
*/
areNumbersEqual: 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>;
/**
* Whether the URLs passed are equal in value.
*/
areUrlsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether two values with unknown `@@toStringTag` are equal in value. This comparator is
* called when no other comparator applies.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
*/
unknownTagComparators: Record<string, TypeEqualityComparator<any, Meta>> | undefined;
}
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.
*/
export type TypedArray =
| BigInt64Array
| BigUint64Array
| 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;
}

33
frontend/node_modules/fast-equals/dist/cjs/utils.d.cts generated vendored Normal file
View File

@ -0,0 +1,33 @@
import type { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes.d.cts';
/**
* 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 `@@toStringTag` of the value, if it exists.
*/
export declare function getShortTag(value: any): string | undefined;
/**
* 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;

View File

@ -0,0 +1,60 @@
import type {
ComparatorConfig,
CreateState,
CustomEqualCreatorOptions,
EqualityComparator,
InternalEqualityComparator,
} from './internalTypes.d.mts';
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>({
areArrayBuffersEqual,
areArraysEqual,
areDataViewsEqual,
areDatesEqual,
areErrorsEqual,
areFunctionsEqual,
areMapsEqual,
areNumbersEqual,
areObjectsEqual,
arePrimitiveWrappersEqual,
areRegExpsEqual,
areSetsEqual,
areTypedArraysEqual,
areUrlsEqual,
unknownTagComparators,
}: 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 {};

62
frontend/node_modules/fast-equals/dist/es/equals.d.mts generated vendored Normal file
View File

@ -0,0 +1,62 @@
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.d.mts';
import type { sameValueZeroEqual } from './utils.d.mts';
/**
* Whether the array buffers are equal in value.
*/
export declare function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean;
/**
* Whether the arrays are equal in value.
*/
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
/**
* Whether the dataviews are equal in value.
*/
export declare function areDataViewsEqual(a: DataView, b: DataView): boolean;
/**
* Whether the dates passed are equal in value.
*/
export declare function areDatesEqual(a: Date, b: Date): boolean;
/**
* Whether the errors passed are equal in value.
*/
export declare function areErrorsEqual(a: Error, b: Error): boolean;
/**
* Whether the functions passed are equal in value.
*/
export declare function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): 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 numbers are equal in value.
*/
export declare const areNumbersEqual: typeof sameValueZeroEqual;
/**
* 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;
/**
* Whether the URL instances are equal in value.
*/
export declare function areUrlsEqual(a: URL, b: URL): boolean;

66
frontend/node_modules/fast-equals/dist/es/index.d.mts generated vendored Normal file
View File

@ -0,0 +1,66 @@
import type { CustomEqualCreatorOptions } from './internalTypes.d.mts';
import type { sameValueZeroEqual } from './utils.d.mts';
export { sameValueZeroEqual };
export type {
AnyEqualityComparator,
Cache,
CircularState,
ComparatorConfig,
CreateCustomComparatorConfig,
CreateState,
CustomEqualCreatorOptions,
DefaultState,
Dictionary,
EqualityComparator,
EqualityComparatorCreator,
InternalEqualityComparator,
PrimitiveWrapper,
State,
TypeEqualityComparator,
TypedArray,
} from './internalTypes.d.mts';
/**
* 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;

642
frontend/node_modules/fast-equals/dist/es/index.mjs generated vendored Normal file
View File

@ -0,0 +1,642 @@
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
// eslint-disable-next-line @typescript-eslint/unbound-method
const { hasOwnProperty } = Object.prototype;
/**
* Combine two comparators into a single comparators.
*/
function combineComparators(comparatorA, comparatorB) {
return function isEqual(a, b, state) {
return comparatorA(a, b, state) && comparatorB(a, b, state);
};
}
/**
* 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.
*/
function createIsCircular(areItemsEqual) {
return function isCircular(a, b, state) {
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
return areItemsEqual(a, b, state);
}
const { cache } = state;
const cachedA = cache.get(a);
const cachedB = cache.get(b);
if (cachedA && cachedB) {
return cachedA === b && cachedB === a;
}
cache.set(a, b);
cache.set(b, a);
const result = areItemsEqual(a, b, state);
cache.delete(a);
cache.delete(b);
return result;
};
}
/**
* Get the `@@toStringTag` of the value, if it exists.
*/
function getShortTag(value) {
return value != null ? value[Symbol.toStringTag] : undefined;
}
/**
* Get the properties to strictly examine, which include both own properties that are
* not enumerable and symbol properties.
*/
function getStrictProperties(object) {
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
}
/**
* Whether the object contains the property passed as an own property.
*/
const hasOwn =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
/**
* Whether the values passed are strictly equal or both NaN.
*/
function sameValueZeroEqual(a, b) {
return a === b || (!a && !b && a !== a && b !== b);
}
const PREACT_VNODE = '__v';
const PREACT_OWNER = '__o';
const REACT_OWNER = '_owner';
const { getOwnPropertyDescriptor, keys } = Object;
/**
* Whether the array buffers are equal in value.
*/
function areArrayBuffersEqual(a, b) {
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
}
/**
* Whether the arrays are equal in value.
*/
function areArraysEqual(a, b, state) {
let index = a.length;
if (b.length !== index) {
return false;
}
while (index-- > 0) {
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
return false;
}
}
return true;
}
/**
* Whether the dataviews are equal in value.
*/
function areDataViewsEqual(a, b) {
return (a.byteLength === b.byteLength
&& areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));
}
/**
* Whether the dates passed are equal in value.
*/
function areDatesEqual(a, b) {
return sameValueZeroEqual(a.getTime(), b.getTime());
}
/**
* Whether the errors passed are equal in value.
*/
function areErrorsEqual(a, b) {
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
}
/**
* Whether the functions passed are equal in value.
*/
function areFunctionsEqual(a, b) {
return a === b;
}
/**
* Whether the `Map`s are equal in value.
*/
function areMapsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.entries();
let aResult;
let bResult;
let index = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.entries();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (matchedIndices[matchIndex]) {
matchIndex++;
continue;
}
const aEntry = aResult.value;
const bEntry = bResult.value;
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
&& state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
index++;
}
return true;
}
/**
* Whether the numbers are equal in value.
*/
const areNumbersEqual = sameValueZeroEqual;
/**
* Whether the objects are equal in value.
*/
function areObjectsEqual(a, b, state) {
const properties = keys(a);
let index = properties.length;
if (keys(b).length !== index) {
return false;
}
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
if (!isPropertyEqual(a, b, state, properties[index])) {
return false;
}
}
return true;
}
/**
* Whether the objects are equal in value with strict property checking.
*/
function areObjectsEqualStrict(a, b, state) {
const properties = getStrictProperties(a);
let index = properties.length;
if (getStrictProperties(b).length !== index) {
return false;
}
let property;
let descriptorA;
let descriptorB;
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
property = properties[index];
if (!isPropertyEqual(a, b, state, property)) {
return false;
}
descriptorA = getOwnPropertyDescriptor(a, property);
descriptorB = getOwnPropertyDescriptor(b, property);
if ((descriptorA || descriptorB)
&& (!descriptorA
|| !descriptorB
|| descriptorA.configurable !== descriptorB.configurable
|| descriptorA.enumerable !== descriptorB.enumerable
|| descriptorA.writable !== descriptorB.writable)) {
return false;
}
}
return true;
}
/**
* Whether the primitive wrappers passed are equal in value.
*/
function arePrimitiveWrappersEqual(a, b) {
return sameValueZeroEqual(a.valueOf(), b.valueOf());
}
/**
* Whether the regexps passed are equal in value.
*/
function areRegExpsEqual(a, b) {
return a.source === b.source && a.flags === b.flags;
}
/**
* Whether the `Set`s are equal in value.
*/
function areSetsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.values();
let aResult;
let bResult;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.values();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (!matchedIndices[matchIndex]
&& state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
}
return true;
}
/**
* Whether the TypedArray instances are equal in value.
*/
function areTypedArraysEqual(a, b) {
let index = a.byteLength;
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
return false;
}
while (index-- > 0) {
if (a[index] !== b[index]) {
return false;
}
}
return true;
}
/**
* Whether the URL instances are equal in value.
*/
function areUrlsEqual(a, b) {
return (a.hostname === b.hostname
&& a.pathname === b.pathname
&& a.protocol === b.protocol
&& a.port === b.port
&& a.hash === b.hash
&& a.username === b.username
&& a.password === b.password);
}
function isPropertyEqual(a, b, state, property) {
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
&& (a.$$typeof || b.$$typeof)) {
return true;
}
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
}
const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
const ARGUMENTS_TAG = '[object Arguments]';
const BOOLEAN_TAG = '[object Boolean]';
const DATA_VIEW_TAG = '[object DataView]';
const DATE_TAG = '[object Date]';
const ERROR_TAG = '[object Error]';
const MAP_TAG = '[object Map]';
const NUMBER_TAG = '[object Number]';
const OBJECT_TAG = '[object Object]';
const REG_EXP_TAG = '[object RegExp]';
const SET_TAG = '[object Set]';
const STRING_TAG = '[object String]';
const TYPED_ARRAY_TAGS = {
'[object Int8Array]': true,
'[object Uint8Array]': true,
'[object Uint8ClampedArray]': true,
'[object Int16Array]': true,
'[object Uint16Array]': true,
'[object Int32Array]': true,
'[object Uint32Array]': true,
'[object Float16Array]': true,
'[object Float32Array]': true,
'[object Float64Array]': true,
'[object BigInt64Array]': true,
'[object BigUint64Array]': true,
};
const URL_TAG = '[object URL]';
// eslint-disable-next-line @typescript-eslint/unbound-method
const toString = Object.prototype.toString;
/**
* Create a comparator method based on the type-specific equality comparators passed.
*/
function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
/**
* compare the value of the two objects and return true if they are equivalent in values
*/
return function comparator(a, b, state) {
// If the items are strictly equal, no need to do a value comparison.
if (a === b) {
return true;
}
// If either of the items are nullish and fail the strictly equal check
// above, then they must be unequal.
if (a == null || b == null) {
return false;
}
const type = typeof a;
if (type !== typeof b) {
return false;
}
if (type !== 'object') {
if (type === 'number') {
return areNumbersEqual(a, b, state);
}
if (type === 'function') {
return areFunctionsEqual(a, b, state);
}
// If a primitive value that is not strictly equal, it must be unequal.
return false;
}
const constructor = a.constructor;
// Checks are listed in order of commonality of use-case:
// 1. Common complex object types (plain object, array)
// 2. Common data values (date, regexp)
// 3. Less-common complex object types (map, set)
// 4. Less-common data values (promise, primitive wrappers)
// Inherently this is both subjective and assumptive, however
// when reviewing comparable libraries in the wild this order
// appears to be generally consistent.
// Constructors should match, otherwise there is potential for false positives
// between class and subclass or custom object and POJO.
if (constructor !== b.constructor) {
return false;
}
// `isPlainObject` only checks against the object's own realm. Cross-realm
// comparisons are rare, and will be handled in the ultimate fallback, so
// we can avoid capturing the string tag.
if (constructor === Object) {
return areObjectsEqual(a, b, state);
}
// `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
// the string tag or doing an `instanceof` check.
if (Array.isArray(a)) {
return areArraysEqual(a, b, state);
}
// Try to fast-path equality checks for other complex object types in the
// same realm to avoid capturing the string tag. Strict equality is used
// instead of `instanceof` because it is more performant for the common
// use-case. If someone is subclassing a native class, it will be handled
// with the string tag comparison.
if (constructor === Date) {
return areDatesEqual(a, b, state);
}
if (constructor === RegExp) {
return areRegExpsEqual(a, b, state);
}
if (constructor === Map) {
return areMapsEqual(a, b, state);
}
if (constructor === Set) {
return areSetsEqual(a, b, state);
}
// Since this is a custom object, capture the string tag to determing its type.
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
const tag = toString.call(a);
if (tag === DATE_TAG) {
return areDatesEqual(a, b, state);
}
// For RegExp, the properties are not enumerable, and therefore will give false positives if
// tested like a standard object.
if (tag === REG_EXP_TAG) {
return areRegExpsEqual(a, b, state);
}
if (tag === MAP_TAG) {
return areMapsEqual(a, b, state);
}
if (tag === SET_TAG) {
return areSetsEqual(a, b, state);
}
if (tag === OBJECT_TAG) {
// The exception for value comparison is custom `Promise`-like class instances. These should
// be treated the same as standard `Promise` objects, which means strict equality, and if
// it reaches this point then that strict equality comparison has already failed.
return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);
}
// If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === URL_TAG) {
return areUrlsEqual(a, b, state);
}
// If an error tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === ERROR_TAG) {
return areErrorsEqual(a, b, state);
}
// If an arguments tag, it should be treated as a standard object.
if (tag === ARGUMENTS_TAG) {
return areObjectsEqual(a, b, state);
}
if (TYPED_ARRAY_TAGS[tag]) {
return areTypedArraysEqual(a, b, state);
}
if (tag === ARRAY_BUFFER_TAG) {
return areArrayBuffersEqual(a, b, state);
}
if (tag === DATA_VIEW_TAG) {
return areDataViewsEqual(a, b, state);
}
// As the penultimate fallback, check if the values passed are primitive wrappers. This
// is very rare in modern JS, which is why it is deprioritized compared to all other object
// types.
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
return arePrimitiveWrappersEqual(a, b, state);
}
if (unknownTagComparators) {
let unknownTagComparator = unknownTagComparators[tag];
if (!unknownTagComparator) {
const shortTag = getShortTag(a);
if (shortTag) {
unknownTagComparator = unknownTagComparators[shortTag];
}
}
// If the custom config has an unknown tag comparator that matches the captured tag or the
// @@toStringTag, it is the source of truth for whether the values are equal.
if (unknownTagComparator) {
return unknownTagComparator(a, b, state);
}
}
// If not matching any tags that require a specific type of comparison, then we hard-code false because
// the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
// - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
// comparison that can be made.
// - For types that can be introspected, but rarely have requirements to be compared
// (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
// use-cases (may be included in a future release, if requested enough).
// - For types that can be introspected but do not have an objective definition of what
// equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
// In all cases, these decisions should be reevaluated based on changes to the language and
// common development practices.
return false;
};
}
/**
* Create the configuration object used for building comparators.
*/
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
let config = {
areArrayBuffersEqual,
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
areDataViewsEqual,
areDatesEqual: areDatesEqual,
areErrorsEqual: areErrorsEqual,
areFunctionsEqual: areFunctionsEqual,
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
areNumbersEqual: areNumbersEqual,
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
areRegExpsEqual: areRegExpsEqual,
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
areTypedArraysEqual: strict
? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
: areTypedArraysEqual,
areUrlsEqual: areUrlsEqual,
unknownTagComparators: undefined,
};
if (createCustomConfig) {
config = Object.assign({}, config, createCustomConfig(config));
}
if (circular) {
const areArraysEqual = createIsCircular(config.areArraysEqual);
const areMapsEqual = createIsCircular(config.areMapsEqual);
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
const areSetsEqual = createIsCircular(config.areSetsEqual);
config = Object.assign({}, config, {
areArraysEqual,
areMapsEqual,
areObjectsEqual,
areSetsEqual,
});
}
return config;
}
/**
* Default equality comparator pass-through, used as the standard `isEqual` creator for
* use inside the built comparator.
*/
function createInternalEqualityComparator(compare) {
return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
return compare(a, b, state);
};
}
/**
* Create the `isEqual` function used by the consuming application.
*/
function createIsEqual({ circular, comparator, createState, equals, strict }) {
if (createState) {
return function isEqual(a, b) {
const { cache = circular ? new WeakMap() : undefined, meta } = createState();
return comparator(a, b, {
cache,
equals,
meta,
strict,
});
};
}
if (circular) {
return function isEqual(a, b) {
return comparator(a, b, {
cache: new WeakMap(),
equals,
meta: undefined,
strict,
});
};
}
const state = {
cache: undefined,
equals,
meta: undefined,
strict,
};
return function isEqual(a, b) {
return comparator(a, b, state);
};
}
/**
* Whether the items passed are deeply-equal in value.
*/
const deepEqual = createCustomEqual();
/**
* Whether the items passed are deeply-equal in value based on strict comparison.
*/
const strictDeepEqual = createCustomEqual({ strict: true });
/**
* Whether the items passed are deeply-equal in value, including circular references.
*/
const circularDeepEqual = createCustomEqual({ circular: true });
/**
* Whether the items passed are deeply-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularDeepEqual = createCustomEqual({
circular: true,
strict: true,
});
/**
* Whether the items passed are shallowly-equal in value.
*/
const shallowEqual = createCustomEqual({
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value based on strict comparison
*/
const strictShallowEqual = createCustomEqual({
strict: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references.
*/
const circularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
strict: true,
});
/**
* 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.
*/
function createCustomEqual(options = {}) {
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;
const config = createEqualityComparatorConfig(options);
const comparator = createEqualityComparator(config);
const equals = createCustomInternalComparator
? createCustomInternalComparator(comparator)
: createInternalEqualityComparator(comparator);
return createIsEqual({ circular, comparator, createState, equals, strict });
}
export { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };
//# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,178 @@
/**
* 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 array buffers passed are equal in value. In strict mode, this includes
* additional properties added to the array.
*/
areArrayBuffersEqual: TypeEqualityComparator<any, 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 data views passed are equal in value.
*/
areDataViewsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the dates passed are equal in value.
*/
areDatesEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the errors passed are equal in value.
*/
areErrorsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the functions passed are equal in value.
*/
areFunctionsEqual: 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 numbers passed are equal in value.
*/
areNumbersEqual: 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>;
/**
* Whether the URLs passed are equal in value.
*/
areUrlsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether two values with unknown `@@toStringTag` are equal in value. This comparator is
* called when no other comparator applies.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
*/
unknownTagComparators: Record<string, TypeEqualityComparator<any, Meta>> | undefined;
}
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.
*/
export type TypedArray =
| BigInt64Array
| BigUint64Array
| 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;
}

33
frontend/node_modules/fast-equals/dist/es/utils.d.mts generated vendored Normal file
View File

@ -0,0 +1,33 @@
import type { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes.d.mts';
/**
* 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 `@@toStringTag` of the value, if it exists.
*/
export declare function getShortTag(value: any): string | undefined;
/**
* 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;

View File

@ -0,0 +1,26 @@
import type { ComparatorConfig, CreateState, CustomEqualCreatorOptions, EqualityComparator, InternalEqualityComparator } from './internalTypes.js';
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>({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }: 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 {};

62
frontend/node_modules/fast-equals/dist/umd/equals.d.ts generated vendored Normal file
View File

@ -0,0 +1,62 @@
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';
import { sameValueZeroEqual } from './utils.js';
/**
* Whether the array buffers are equal in value.
*/
export declare function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean;
/**
* Whether the arrays are equal in value.
*/
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
/**
* Whether the dataviews are equal in value.
*/
export declare function areDataViewsEqual(a: DataView, b: DataView): boolean;
/**
* Whether the dates passed are equal in value.
*/
export declare function areDatesEqual(a: Date, b: Date): boolean;
/**
* Whether the errors passed are equal in value.
*/
export declare function areErrorsEqual(a: Error, b: Error): boolean;
/**
* Whether the functions passed are equal in value.
*/
export declare function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): 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 numbers are equal in value.
*/
export declare const areNumbersEqual: typeof sameValueZeroEqual;
/**
* 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;
/**
* Whether the URL instances are equal in value.
*/
export declare function areUrlsEqual(a: URL, b: URL): boolean;

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

@ -0,0 +1,47 @@
import type { CustomEqualCreatorOptions } from './internalTypes.js';
import { sameValueZeroEqual } from './utils.js';
export { sameValueZeroEqual };
export type { AnyEqualityComparator, Cache, CircularState, ComparatorConfig, CreateCustomComparatorConfig, CreateState, CustomEqualCreatorOptions, DefaultState, Dictionary, EqualityComparator, EqualityComparatorCreator, InternalEqualityComparator, PrimitiveWrapper, State, TypeEqualityComparator, TypedArray, } from './internalTypes.js';
/**
* 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;

659
frontend/node_modules/fast-equals/dist/umd/index.js generated vendored Normal file
View File

@ -0,0 +1,659 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["fast-equals"] = {}));
})(this, (function (exports) { 'use strict';
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
// eslint-disable-next-line @typescript-eslint/unbound-method
const { hasOwnProperty } = Object.prototype;
/**
* Combine two comparators into a single comparators.
*/
function combineComparators(comparatorA, comparatorB) {
return function isEqual(a, b, state) {
return comparatorA(a, b, state) && comparatorB(a, b, state);
};
}
/**
* 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.
*/
function createIsCircular(areItemsEqual) {
return function isCircular(a, b, state) {
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
return areItemsEqual(a, b, state);
}
const { cache } = state;
const cachedA = cache.get(a);
const cachedB = cache.get(b);
if (cachedA && cachedB) {
return cachedA === b && cachedB === a;
}
cache.set(a, b);
cache.set(b, a);
const result = areItemsEqual(a, b, state);
cache.delete(a);
cache.delete(b);
return result;
};
}
/**
* Get the `@@toStringTag` of the value, if it exists.
*/
function getShortTag(value) {
return value != null ? value[Symbol.toStringTag] : undefined;
}
/**
* Get the properties to strictly examine, which include both own properties that are
* not enumerable and symbol properties.
*/
function getStrictProperties(object) {
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
}
/**
* Whether the object contains the property passed as an own property.
*/
const hasOwn =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
/**
* Whether the values passed are strictly equal or both NaN.
*/
function sameValueZeroEqual(a, b) {
return a === b || (!a && !b && a !== a && b !== b);
}
const PREACT_VNODE = '__v';
const PREACT_OWNER = '__o';
const REACT_OWNER = '_owner';
const { getOwnPropertyDescriptor, keys } = Object;
/**
* Whether the array buffers are equal in value.
*/
function areArrayBuffersEqual(a, b) {
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
}
/**
* Whether the arrays are equal in value.
*/
function areArraysEqual(a, b, state) {
let index = a.length;
if (b.length !== index) {
return false;
}
while (index-- > 0) {
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
return false;
}
}
return true;
}
/**
* Whether the dataviews are equal in value.
*/
function areDataViewsEqual(a, b) {
return (a.byteLength === b.byteLength
&& areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));
}
/**
* Whether the dates passed are equal in value.
*/
function areDatesEqual(a, b) {
return sameValueZeroEqual(a.getTime(), b.getTime());
}
/**
* Whether the errors passed are equal in value.
*/
function areErrorsEqual(a, b) {
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
}
/**
* Whether the functions passed are equal in value.
*/
function areFunctionsEqual(a, b) {
return a === b;
}
/**
* Whether the `Map`s are equal in value.
*/
function areMapsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.entries();
let aResult;
let bResult;
let index = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.entries();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (matchedIndices[matchIndex]) {
matchIndex++;
continue;
}
const aEntry = aResult.value;
const bEntry = bResult.value;
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
&& state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
index++;
}
return true;
}
/**
* Whether the numbers are equal in value.
*/
const areNumbersEqual = sameValueZeroEqual;
/**
* Whether the objects are equal in value.
*/
function areObjectsEqual(a, b, state) {
const properties = keys(a);
let index = properties.length;
if (keys(b).length !== index) {
return false;
}
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
if (!isPropertyEqual(a, b, state, properties[index])) {
return false;
}
}
return true;
}
/**
* Whether the objects are equal in value with strict property checking.
*/
function areObjectsEqualStrict(a, b, state) {
const properties = getStrictProperties(a);
let index = properties.length;
if (getStrictProperties(b).length !== index) {
return false;
}
let property;
let descriptorA;
let descriptorB;
// Decrementing `while` showed faster results than either incrementing or
// decrementing `for` loop and than an incrementing `while` loop. Declarative
// methods like `some` / `every` were not used to avoid incurring the garbage
// cost of anonymous callbacks.
while (index-- > 0) {
property = properties[index];
if (!isPropertyEqual(a, b, state, property)) {
return false;
}
descriptorA = getOwnPropertyDescriptor(a, property);
descriptorB = getOwnPropertyDescriptor(b, property);
if ((descriptorA || descriptorB)
&& (!descriptorA
|| !descriptorB
|| descriptorA.configurable !== descriptorB.configurable
|| descriptorA.enumerable !== descriptorB.enumerable
|| descriptorA.writable !== descriptorB.writable)) {
return false;
}
}
return true;
}
/**
* Whether the primitive wrappers passed are equal in value.
*/
function arePrimitiveWrappersEqual(a, b) {
return sameValueZeroEqual(a.valueOf(), b.valueOf());
}
/**
* Whether the regexps passed are equal in value.
*/
function areRegExpsEqual(a, b) {
return a.source === b.source && a.flags === b.flags;
}
/**
* Whether the `Set`s are equal in value.
*/
function areSetsEqual(a, b, state) {
const size = a.size;
if (size !== b.size) {
return false;
}
if (!size) {
return true;
}
const matchedIndices = new Array(size);
const aIterable = a.values();
let aResult;
let bResult;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((aResult = aIterable.next())) {
if (aResult.done) {
break;
}
const bIterable = b.values();
let hasMatch = false;
let matchIndex = 0;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while ((bResult = bIterable.next())) {
if (bResult.done) {
break;
}
if (!matchedIndices[matchIndex]
&& state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
hasMatch = matchedIndices[matchIndex] = true;
break;
}
matchIndex++;
}
if (!hasMatch) {
return false;
}
}
return true;
}
/**
* Whether the TypedArray instances are equal in value.
*/
function areTypedArraysEqual(a, b) {
let index = a.byteLength;
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
return false;
}
while (index-- > 0) {
if (a[index] !== b[index]) {
return false;
}
}
return true;
}
/**
* Whether the URL instances are equal in value.
*/
function areUrlsEqual(a, b) {
return (a.hostname === b.hostname
&& a.pathname === b.pathname
&& a.protocol === b.protocol
&& a.port === b.port
&& a.hash === b.hash
&& a.username === b.username
&& a.password === b.password);
}
function isPropertyEqual(a, b, state, property) {
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
&& (a.$$typeof || b.$$typeof)) {
return true;
}
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
}
const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
const ARGUMENTS_TAG = '[object Arguments]';
const BOOLEAN_TAG = '[object Boolean]';
const DATA_VIEW_TAG = '[object DataView]';
const DATE_TAG = '[object Date]';
const ERROR_TAG = '[object Error]';
const MAP_TAG = '[object Map]';
const NUMBER_TAG = '[object Number]';
const OBJECT_TAG = '[object Object]';
const REG_EXP_TAG = '[object RegExp]';
const SET_TAG = '[object Set]';
const STRING_TAG = '[object String]';
const TYPED_ARRAY_TAGS = {
'[object Int8Array]': true,
'[object Uint8Array]': true,
'[object Uint8ClampedArray]': true,
'[object Int16Array]': true,
'[object Uint16Array]': true,
'[object Int32Array]': true,
'[object Uint32Array]': true,
'[object Float16Array]': true,
'[object Float32Array]': true,
'[object Float64Array]': true,
'[object BigInt64Array]': true,
'[object BigUint64Array]': true,
};
const URL_TAG = '[object URL]';
// eslint-disable-next-line @typescript-eslint/unbound-method
const toString = Object.prototype.toString;
/**
* Create a comparator method based on the type-specific equality comparators passed.
*/
function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
/**
* compare the value of the two objects and return true if they are equivalent in values
*/
return function comparator(a, b, state) {
// If the items are strictly equal, no need to do a value comparison.
if (a === b) {
return true;
}
// If either of the items are nullish and fail the strictly equal check
// above, then they must be unequal.
if (a == null || b == null) {
return false;
}
const type = typeof a;
if (type !== typeof b) {
return false;
}
if (type !== 'object') {
if (type === 'number') {
return areNumbersEqual(a, b, state);
}
if (type === 'function') {
return areFunctionsEqual(a, b, state);
}
// If a primitive value that is not strictly equal, it must be unequal.
return false;
}
const constructor = a.constructor;
// Checks are listed in order of commonality of use-case:
// 1. Common complex object types (plain object, array)
// 2. Common data values (date, regexp)
// 3. Less-common complex object types (map, set)
// 4. Less-common data values (promise, primitive wrappers)
// Inherently this is both subjective and assumptive, however
// when reviewing comparable libraries in the wild this order
// appears to be generally consistent.
// Constructors should match, otherwise there is potential for false positives
// between class and subclass or custom object and POJO.
if (constructor !== b.constructor) {
return false;
}
// `isPlainObject` only checks against the object's own realm. Cross-realm
// comparisons are rare, and will be handled in the ultimate fallback, so
// we can avoid capturing the string tag.
if (constructor === Object) {
return areObjectsEqual(a, b, state);
}
// `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
// the string tag or doing an `instanceof` check.
if (Array.isArray(a)) {
return areArraysEqual(a, b, state);
}
// Try to fast-path equality checks for other complex object types in the
// same realm to avoid capturing the string tag. Strict equality is used
// instead of `instanceof` because it is more performant for the common
// use-case. If someone is subclassing a native class, it will be handled
// with the string tag comparison.
if (constructor === Date) {
return areDatesEqual(a, b, state);
}
if (constructor === RegExp) {
return areRegExpsEqual(a, b, state);
}
if (constructor === Map) {
return areMapsEqual(a, b, state);
}
if (constructor === Set) {
return areSetsEqual(a, b, state);
}
// Since this is a custom object, capture the string tag to determing its type.
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
const tag = toString.call(a);
if (tag === DATE_TAG) {
return areDatesEqual(a, b, state);
}
// For RegExp, the properties are not enumerable, and therefore will give false positives if
// tested like a standard object.
if (tag === REG_EXP_TAG) {
return areRegExpsEqual(a, b, state);
}
if (tag === MAP_TAG) {
return areMapsEqual(a, b, state);
}
if (tag === SET_TAG) {
return areSetsEqual(a, b, state);
}
if (tag === OBJECT_TAG) {
// The exception for value comparison is custom `Promise`-like class instances. These should
// be treated the same as standard `Promise` objects, which means strict equality, and if
// it reaches this point then that strict equality comparison has already failed.
return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);
}
// If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === URL_TAG) {
return areUrlsEqual(a, b, state);
}
// If an error tag, it should be tested explicitly. Like RegExp, the properties are not
// enumerable, and therefore will give false positives if tested like a standard object.
if (tag === ERROR_TAG) {
return areErrorsEqual(a, b, state);
}
// If an arguments tag, it should be treated as a standard object.
if (tag === ARGUMENTS_TAG) {
return areObjectsEqual(a, b, state);
}
if (TYPED_ARRAY_TAGS[tag]) {
return areTypedArraysEqual(a, b, state);
}
if (tag === ARRAY_BUFFER_TAG) {
return areArrayBuffersEqual(a, b, state);
}
if (tag === DATA_VIEW_TAG) {
return areDataViewsEqual(a, b, state);
}
// As the penultimate fallback, check if the values passed are primitive wrappers. This
// is very rare in modern JS, which is why it is deprioritized compared to all other object
// types.
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
return arePrimitiveWrappersEqual(a, b, state);
}
if (unknownTagComparators) {
let unknownTagComparator = unknownTagComparators[tag];
if (!unknownTagComparator) {
const shortTag = getShortTag(a);
if (shortTag) {
unknownTagComparator = unknownTagComparators[shortTag];
}
}
// If the custom config has an unknown tag comparator that matches the captured tag or the
// @@toStringTag, it is the source of truth for whether the values are equal.
if (unknownTagComparator) {
return unknownTagComparator(a, b, state);
}
}
// If not matching any tags that require a specific type of comparison, then we hard-code false because
// the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
// - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
// comparison that can be made.
// - For types that can be introspected, but rarely have requirements to be compared
// (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
// use-cases (may be included in a future release, if requested enough).
// - For types that can be introspected but do not have an objective definition of what
// equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
// In all cases, these decisions should be reevaluated based on changes to the language and
// common development practices.
return false;
};
}
/**
* Create the configuration object used for building comparators.
*/
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
let config = {
areArrayBuffersEqual,
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
areDataViewsEqual,
areDatesEqual: areDatesEqual,
areErrorsEqual: areErrorsEqual,
areFunctionsEqual: areFunctionsEqual,
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
areNumbersEqual: areNumbersEqual,
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
areRegExpsEqual: areRegExpsEqual,
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
areTypedArraysEqual: strict
? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
: areTypedArraysEqual,
areUrlsEqual: areUrlsEqual,
unknownTagComparators: undefined,
};
if (createCustomConfig) {
config = Object.assign({}, config, createCustomConfig(config));
}
if (circular) {
const areArraysEqual = createIsCircular(config.areArraysEqual);
const areMapsEqual = createIsCircular(config.areMapsEqual);
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
const areSetsEqual = createIsCircular(config.areSetsEqual);
config = Object.assign({}, config, {
areArraysEqual,
areMapsEqual,
areObjectsEqual,
areSetsEqual,
});
}
return config;
}
/**
* Default equality comparator pass-through, used as the standard `isEqual` creator for
* use inside the built comparator.
*/
function createInternalEqualityComparator(compare) {
return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
return compare(a, b, state);
};
}
/**
* Create the `isEqual` function used by the consuming application.
*/
function createIsEqual({ circular, comparator, createState, equals, strict }) {
if (createState) {
return function isEqual(a, b) {
const { cache = circular ? new WeakMap() : undefined, meta } = createState();
return comparator(a, b, {
cache,
equals,
meta,
strict,
});
};
}
if (circular) {
return function isEqual(a, b) {
return comparator(a, b, {
cache: new WeakMap(),
equals,
meta: undefined,
strict,
});
};
}
const state = {
cache: undefined,
equals,
meta: undefined,
strict,
};
return function isEqual(a, b) {
return comparator(a, b, state);
};
}
/**
* Whether the items passed are deeply-equal in value.
*/
const deepEqual = createCustomEqual();
/**
* Whether the items passed are deeply-equal in value based on strict comparison.
*/
const strictDeepEqual = createCustomEqual({ strict: true });
/**
* Whether the items passed are deeply-equal in value, including circular references.
*/
const circularDeepEqual = createCustomEqual({ circular: true });
/**
* Whether the items passed are deeply-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularDeepEqual = createCustomEqual({
circular: true,
strict: true,
});
/**
* Whether the items passed are shallowly-equal in value.
*/
const shallowEqual = createCustomEqual({
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value based on strict comparison
*/
const strictShallowEqual = createCustomEqual({
strict: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references.
*/
const circularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
});
/**
* Whether the items passed are shallowly-equal in value, including circular references,
* based on strict comparison.
*/
const strictCircularShallowEqual = createCustomEqual({
circular: true,
createInternalComparator: () => sameValueZeroEqual,
strict: true,
});
/**
* 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.
*/
function createCustomEqual(options = {}) {
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;
const config = createEqualityComparatorConfig(options);
const comparator = createEqualityComparator(config);
const equals = createCustomInternalComparator
? createCustomInternalComparator(comparator)
: createInternalEqualityComparator(comparator);
return createIsEqual({ circular, comparator, createState, equals, strict });
}
exports.circularDeepEqual = circularDeepEqual;
exports.circularShallowEqual = circularShallowEqual;
exports.createCustomEqual = createCustomEqual;
exports.deepEqual = deepEqual;
exports.sameValueZeroEqual = sameValueZeroEqual;
exports.shallowEqual = shallowEqual;
exports.strictCircularDeepEqual = strictCircularDeepEqual;
exports.strictCircularShallowEqual = strictCircularShallowEqual;
exports.strictDeepEqual = strictDeepEqual;
exports.strictShallowEqual = strictShallowEqual;
}));
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,159 @@
/**
* 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 array buffers passed are equal in value. In strict mode, this includes
* additional properties added to the array.
*/
areArrayBuffersEqual: TypeEqualityComparator<any, 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 data views passed are equal in value.
*/
areDataViewsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the dates passed are equal in value.
*/
areDatesEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the errors passed are equal in value.
*/
areErrorsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the functions passed are equal in value.
*/
areFunctionsEqual: 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 numbers passed are equal in value.
*/
areNumbersEqual: 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>;
/**
* Whether the URLs passed are equal in value.
*/
areUrlsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether two values with unknown `@@toStringTag` are equal in value. This comparator is
* called when no other comparator applies.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
*/
unknownTagComparators: Record<string, TypeEqualityComparator<any, Meta>> | undefined;
}
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.
*/
export type TypedArray = BigInt64Array | BigUint64Array | 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;
}

28
frontend/node_modules/fast-equals/dist/umd/utils.d.ts generated vendored Normal file
View File

@ -0,0 +1,28 @@
import type { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes.js';
/**
* 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 `@@toStringTag` of the value, if it exists.
*/
export declare function getShortTag(value: any): string | undefined;
/**
* 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;

260
frontend/node_modules/fast-equals/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,260 @@
/**
* Cache used to store references to objects, used for circular
* reference checks.
*/
interface Cache<Key extends object, Value> {
delete(key: Key): boolean;
get(key: Key): Value | undefined;
set(key: Key, value: any): any;
}
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;
}
interface CircularState<Meta> extends State<Meta> {
readonly cache: Cache<any, any>;
}
interface DefaultState<Meta> extends State<Meta> {
readonly cache: undefined;
}
interface Dictionary<Value = any> {
[key: string | symbol]: Value;
$$typeof?: any;
}
interface ComparatorConfig<Meta> {
/**
* Whether the array buffers passed are equal in value. In strict mode, this includes
* additional properties added to the array.
*/
areArrayBuffersEqual: TypeEqualityComparator<any, 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 data views passed are equal in value.
*/
areDataViewsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the dates passed are equal in value.
*/
areDatesEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the errors passed are equal in value.
*/
areErrorsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether the functions passed are equal in value.
*/
areFunctionsEqual: 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 numbers passed are equal in value.
*/
areNumbersEqual: 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>;
/**
* Whether the URLs passed are equal in value.
*/
areUrlsEqual: TypeEqualityComparator<any, Meta>;
/**
* Whether two values with unknown `@@toStringTag` are equal in value. This comparator is
* called when no other comparator applies.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
*/
unknownTagComparators: Record<string, TypeEqualityComparator<any, Meta>> | undefined;
}
type CreateCustomComparatorConfig<Meta> = (config: ComparatorConfig<Meta>) => Partial<ComparatorConfig<Meta>>;
type CreateState<Meta> = () => {
cache?: Cache<any, any> | undefined;
meta?: Meta;
};
type EqualityComparator<Meta> = <A, B>(a: A, b: B, state: State<Meta>) => boolean;
type AnyEqualityComparator<Meta> = (a: any, b: any, state: State<Meta>) => boolean;
type EqualityComparatorCreator<Meta> = (fn: EqualityComparator<Meta>) => InternalEqualityComparator<Meta>;
type InternalEqualityComparator<Meta> = (
a: any,
b: any,
indexOrKeyA: any,
indexOrKeyB: any,
parentA: any,
parentB: any,
state: State<Meta>,
) => boolean;
type PrimitiveWrapper = Boolean | Number | String;
/**
* Type which encompasses possible instances of TypedArray
* classes.
*/
type TypedArray =
| BigInt64Array
| BigUint64Array
| Float32Array
| Float64Array
| Int8Array
| Int16Array
| Int32Array
| Uint16Array
| Uint32Array
| Uint8Array
| Uint8ClampedArray;
type TypeEqualityComparator<Type, Meta = undefined> = (a: Type, b: Type, state: State<Meta>) => boolean;
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;
}
/**
* Whether the values passed are strictly equal or both NaN.
*/
declare function sameValueZeroEqual(a: any, b: any): boolean;
/**
* Whether the items passed are deeply-equal in value.
*/
declare const deepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are deeply-equal in value based on strict comparison.
*/
declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are deeply-equal in value, including circular references.
*/
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.
*/
declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value.
*/
declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value based on strict comparison
*/
declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
/**
* Whether the items passed are shallowly-equal in value, including circular references.
*/
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.
*/
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.
*/
declare function createCustomEqual<Meta = undefined>(
options?: CustomEqualCreatorOptions<Meta>,
): <A, B>(a: A, b: B) => boolean;
export {
circularDeepEqual,
circularShallowEqual,
createCustomEqual,
deepEqual,
sameValueZeroEqual,
shallowEqual,
strictCircularDeepEqual,
strictCircularShallowEqual,
strictDeepEqual,
strictShallowEqual,
};
export type {
AnyEqualityComparator,
Cache,
CircularState,
ComparatorConfig,
CreateCustomComparatorConfig,
CreateState,
CustomEqualCreatorOptions,
DefaultState,
Dictionary,
EqualityComparator,
EqualityComparatorCreator,
InternalEqualityComparator,
PrimitiveWrapper,
State,
TypeEqualityComparator,
TypedArray,
};

113
frontend/node_modules/fast-equals/package.json generated vendored Normal file
View File

@ -0,0 +1,113 @@
{
"author": "tony_quetano@planttheidea.com",
"browser": "dist/umd/index.js",
"bugs": {
"url": "https://github.com/planttheidea/fast-equals/issues"
},
"description": "A blazing fast equality comparison, either shallow or deep",
"devDependencies": {
"@planttheidea/build-tools": "^1.2.3",
"@types/lodash": "^4.17.21",
"@types/node": "^24.10.3",
"@types/ramda": "^0.31.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"@vitest/coverage-v8": "^4.0.15",
"cli-table3": "^0.6.5",
"decircularize": "^1.0.0",
"deep-eql": "^5.0.2",
"deep-equal": "^2.2.3",
"dequal": "^2.0.3",
"eslint": "^9.39.2",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.32.0",
"fast-deep-equal": "^3.1.3",
"fast-glob": "^3.3.3",
"lodash": "^4.17.21",
"nano-equal": "^2.0.2",
"prettier": "^3.7.4",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-fast-compare": "^3.2.2",
"release-it": "^19.1.0",
"rollup": "^4.53.3",
"shallow-equal-fuzzy": "^0.0.2",
"tinybench": "^6.0.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.49.0",
"underscore": "^1.13.7",
"vite": "^7.2.7",
"vitest": "^4.0.15"
},
"engines": {
"node": ">=6.0.0"
},
"exports": {
".": {
"import": {
"types": "./dist/es/index.d.mts",
"default": "./dist/es/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
},
"default": {
"types": "./dist/umd/index.d.ts",
"default": "./dist/umd/index.js"
}
}
},
"files": [
"dist",
"LICENSE",
"README.md",
"index.d.ts",
"package.json"
],
"homepage": "https://github.com/planttheidea/fast-equals#readme",
"keywords": [
"fast",
"equal",
"equals",
"deep-equal",
"equivalent"
],
"license": "MIT",
"main": "dist/cjs/index.cjs",
"module": "dist/es/index.mjs",
"name": "fast-equals",
"repository": {
"type": "git",
"url": "git+https://github.com/planttheidea/fast-equals.git"
},
"scripts": {
"benchmark": "npm run build && node benchmark/index.js",
"build": "npm run clean && npm run build:dist && npm run build:types",
"build:dist": "NODE_ENV=production rollup -c config/rollup.config.js",
"build:types": "pti fix-types -l dist",
"clean": "rm -rf dist",
"clean:cjs": "rm -rf dist/cjs",
"clean:es": "rm -rf dist/es",
"clean:umd": "rm -rf dist/umd",
"dev": "vite --config=config/vite.config.ts",
"format": "prettier . --log-level=warn --write",
"format:check": "prettier . --log-level=warn --check",
"lint": "eslint --max-warnings=0",
"lint:fix": "npm run lint -- --fix",
"release:alpha": "release-it --config=config/release-it/alpha.json",
"release:beta": "release-it --config=config/release-it/beta.json",
"release:rc": "release-it --config=config/release-it/rc.json",
"release:scripts": "npm run format:check && npm run typecheck && npm run lint && npm run test && npm run build",
"release:stable": "release-it --config=config/release-it/stable.json",
"start": "npm run dev",
"test": "vitest run --config=config/vitest.config.ts",
"typecheck": "tsc --noEmit"
},
"sideEffects": false,
"type": "module",
"types": "./index.d.ts",
"version": "5.4.0"
}