FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

33
node_modules/superstruct/dist/error.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
/**
* A `StructFailure` represents a single specific failure in validation.
*/
export type Failure = {
value: any;
key: any;
type: string;
refinement: string | undefined;
message: string;
explanation?: string;
branch: Array<any>;
path: Array<any>;
};
/**
* `StructError` objects are thrown (or returned) when validation fails.
*
* Validation logic is design to exit early for maximum performance. The error
* represents the first error encountered during validation. For more detail,
* the `error.failures` property is a generator function that can be run to
* continue validation and receive all the failures in the data.
*/
export declare class StructError extends TypeError {
value: any;
key: any;
type: string;
refinement: string | undefined;
path: Array<any>;
branch: Array<any>;
failures: () => Array<Failure>;
[x: string]: any;
constructor(failure: Failure, failures: () => Generator<Failure>);
}
//# sourceMappingURL=error.d.ts.map

1
node_modules/superstruct/dist/error.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,GAAG,CAAA;IACV,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IAClB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CACjB,CAAA;AAED;;;;;;;GAOG;AAEH,qBAAa,WAAY,SAAQ,SAAS;IACxC,KAAK,EAAE,GAAG,CAAA;IACV,GAAG,EAAG,GAAG,CAAA;IACT,IAAI,EAAG,MAAM,CAAA;IACb,UAAU,EAAG,MAAM,GAAG,SAAS,CAAA;IAC/B,IAAI,EAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IACjB,MAAM,EAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IACnB,QAAQ,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;gBAEJ,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC,OAAO,CAAC;CAcjE"}

1084
node_modules/superstruct/dist/index.cjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/superstruct/dist/index.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/superstruct/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export * from './error.js';
export * from './struct.js';
export * from './structs/coercions.js';
export * from './structs/refinements.js';
export * from './structs/types.js';
export * from './structs/utilities.js';
//# sourceMappingURL=index.d.ts.map

1
node_modules/superstruct/dist/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA"}

1026
node_modules/superstruct/dist/index.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/superstruct/dist/index.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

119
node_modules/superstruct/dist/struct.d.ts generated vendored Normal file
View File

@@ -0,0 +1,119 @@
import { StructSchema } from './utils.js';
import { StructError, Failure } from './error.js';
/**
* `Struct` objects encapsulate the validation logic for a specific type of
* values. Once constructed, you use the `assert`, `is` or `validate` helpers to
* validate unknown input data against the struct.
*/
export declare class Struct<T = unknown, S = unknown> {
readonly TYPE: T;
type: string;
schema: S;
coercer: (value: unknown, context: Context) => unknown;
validator: (value: unknown, context: Context) => Iterable<Failure>;
refiner: (value: T, context: Context) => Iterable<Failure>;
entries: (value: unknown, context: Context) => Iterable<[string | number, unknown, Struct<any> | Struct<never>]>;
constructor(props: {
type: string;
schema: S;
coercer?: Coercer;
validator?: Validator;
refiner?: Refiner<T>;
entries?: Struct<T, S>['entries'];
});
/**
* Assert that a value passes the struct's validation, throwing if it doesn't.
*/
assert(value: unknown, message?: string): asserts value is T;
/**
* Create a value with the struct's coercion logic, then validate it.
*/
create(value: unknown, message?: string): T;
/**
* Check if a value passes the struct's validation.
*/
is(value: unknown): value is T;
/**
* Mask a value, coercing and validating it, but returning only the subset of
* properties defined by the struct's schema. Masking applies recursively to
* props of `object` structs only.
*/
mask(value: unknown, message?: string): T;
/**
* Validate a value with the struct's validation logic, returning a tuple
* representing the result.
*
* You may optionally pass `true` for the `coerce` argument to coerce
* the value before attempting to validate it. If you do, the result will
* contain the coerced result when successful. Also, `mask` will turn on
* masking of the unknown `object` props recursively if passed.
*/
validate(value: unknown, options?: {
coerce?: boolean;
mask?: boolean;
message?: string;
}): [StructError, undefined] | [undefined, T];
}
/**
* Assert that a value passes a struct, throwing if it doesn't.
*/
export declare function assert<T, S>(value: unknown, struct: Struct<T, S>, message?: string): asserts value is T;
/**
* Create a value with the coercion logic of struct and validate it.
*/
export declare function create<T, S>(value: unknown, struct: Struct<T, S>, message?: string): T;
/**
* Mask a value, returning only the subset of properties defined by a struct.
*/
export declare function mask<T, S>(value: unknown, struct: Struct<T, S>, message?: string): T;
/**
* Check if a value passes a struct.
*/
export declare function is<T, S>(value: unknown, struct: Struct<T, S>): value is T;
/**
* Validate a value against a struct, returning an error if invalid, or the
* value (with potential coercion) if valid.
*/
export declare function validate<T, S>(value: unknown, struct: Struct<T, S>, options?: {
coerce?: boolean;
mask?: boolean;
message?: string;
}): [StructError, undefined] | [undefined, T];
/**
* A `Context` contains information about the current location of the
* validation inside the initial input value. It also carries `mask`
* since it's a run-time flag determining how the validation was invoked
* (via `mask()` or via `validate()`), plus it applies recursively
* to all of the nested structs.
*/
export type Context = {
branch: Array<any>;
path: Array<any>;
mask?: boolean;
};
/**
* A type utility to extract the type from a `Struct` class.
*/
export type Infer<T extends Struct<any, any>> = T['TYPE'];
/**
* A type utility to describe that a struct represents a TypeScript type.
*/
export type Describe<T> = Struct<T, StructSchema<T>>;
/**
* A `Result` is returned from validation functions.
*/
export type Result = boolean | string | Partial<Failure> | Iterable<boolean | string | Partial<Failure>>;
/**
* A `Coercer` takes an unknown value and optionally coerces it.
*/
export type Coercer<T = unknown> = (value: T, context: Context) => unknown;
/**
* A `Validator` takes an unknown value and validates it.
*/
export type Validator = (value: unknown, context: Context) => Result;
/**
* A `Refiner` takes a value of a known type and validates it against a further
* constraint.
*/
export type Refiner<T> = (value: T, context: Context) => Result;
//# sourceMappingURL=struct.d.ts.map

1
node_modules/superstruct/dist/struct.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../src/struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,YAAY,EAAO,MAAM,YAAY,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;GAIG;AAEH,qBAAa,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IAC1C,QAAQ,CAAC,IAAI,EAAG,CAAC,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,CAAC,CAAA;IACT,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;IACtD,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,E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AAC,CAAA;IAClB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;GAEG;AAEH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD;;GAEG;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpD;;GAEG;AAEH,MAAM,MAAM,MAAM,GACd,OAAO,GACP,MAAM,GACN,OAAO,CAAC,OAAO,CAAC,GAChB,QAAQ,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAEjD;;GAEG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;AAE1E;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;AAEpE;;;GAGG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA"}

29
node_modules/superstruct/dist/structs/coercions.d.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import { Struct, Coercer } from '../struct.js';
/**
* Augment a `Struct` to add an additional coercion step to its input.
*
* This allows you to transform input data before validating it, to increase the
* likelihood that it passes validation—for example for default values, parsing
* different formats, etc.
*
* Note: You must use `create(value, Struct)` on the value to have the coercion
* take effect! Using simply `assert()` or `is()` will not use coercion.
*/
export declare function coerce<T, S, C>(struct: Struct<T, S>, condition: Struct<C, any>, coercer: Coercer<C>): Struct<T, S>;
/**
* Augment a struct to replace `undefined` values with a default.
*
* Note: You must use `create(value, Struct)` on the value to have the coercion
* take effect! Using simply `assert()` or `is()` will not use coercion.
*/
export declare function defaulted<T, S>(struct: Struct<T, S>, fallback: any, options?: {
strict?: boolean;
}): Struct<T, S>;
/**
* Augment a struct to trim string inputs.
*
* Note: You must use `create(value, Struct)` on the value to have the coercion
* take effect! Using simply `assert()` or `is()` will not use coercion.
*/
export declare function trimmed<T, S>(struct: Struct<T, S>): Struct<T, S>;
//# sourceMappingURL=coercions.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"coercions.d.ts","sourceRoot":"","sources":["../../src/structs/coercions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAM,OAAO,EAAE,MAAM,cAAc,CAAA;AAIlD;;;;;;;;;GASG;AAEH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC5B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,SAAS,EAAE,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,EACzB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CASd;AAED;;;;;GAKG;AAEH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,QAAQ,EAAE,GAAG,EACb,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,OAAO,CAAA;CACZ,GACL,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CA0Bd;AAED;;;;;GAKG;AAEH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAEhE"}

38
node_modules/superstruct/dist/structs/refinements.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import { Struct, Refiner } from '../struct.js';
/**
* Ensure that a string, array, map, or set is empty.
*/
export declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>;
/**
* Ensure that a number or date is below a threshold.
*/
export declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: {
exclusive?: boolean;
}): Struct<T, S>;
/**
* Ensure that a number or date is above a threshold.
*/
export declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: {
exclusive?: boolean;
}): Struct<T, S>;
/**
* Ensure that a string, array, map or set is not empty.
*/
export declare function nonempty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>;
/**
* Ensure that a string matches a regular expression.
*/
export declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>;
/**
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`.
*/
export declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>;
/**
* Augment a `Struct` to add an additional refinement to the validation.
*
* The refiner function is guaranteed to receive a value of the struct's type,
* because the struct's existing validation will already have passed. This
* allows you to layer additional validation on top of existing structs.
*/
export declare function refine<T, S>(struct: Struct<T, S>, name: string, refiner: Refiner<T>): Struct<T, S>;
//# sourceMappingURL=refinements.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"refinements.d.ts","sourceRoot":"","sources":["../../src/structs/refinements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAG9C;;GAEG;AAEH,wBAAgB,KAAK,CACnB,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,EACnD,CAAC,SAAS,GAAG,EACb,MAAM,EAAE,MAAM,CAAC,CAAC,EA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CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,EACnE,CAAC,SAAS,GAAG,EACb,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAY,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAwBpE;AAED;;;;;;GAMG;AAEH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EACzB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAad"}

142
node_modules/superstruct/dist/structs/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import { Infer, Struct } from '../struct.js';
import { ObjectSchema, ObjectType, AnyStruct, InferStructTuple, UnionToIntersection } from '../utils.js';
/**
* Ensure that any value passes validation.
*/
export declare function any(): Struct<any, null>;
/**
* Ensure that a value is an array and that its elements are of a specific type.
*
* Note: If you omit the element struct, the arrays elements will not be
* iterated at all. This can be helpful for cases where performance is critical,
* and it is preferred to using `array(any())`.
*/
export declare function array<T extends Struct<any>>(Element: T): Struct<Infer<T>[], T>;
export declare function array(): Struct<unknown[], undefined>;
/**
* Ensure that a value is a bigint.
*/
export declare function bigint(): Struct<bigint, null>;
/**
* Ensure that a value is a boolean.
*/
export declare function boolean(): Struct<boolean, null>;
/**
* Ensure that a value is a valid `Date`.
*
* Note: this also ensures that the value is *not* an invalid `Date` object,
* which can occur when parsing a date fails but still returns a `Date`.
*/
export declare function date(): Struct<Date, null>;
/**
* Ensure that a value is one of a set of potential values.
*
* Note: after creating the struct, you can access the definition of the
* potential values as `struct.schema`.
*/
export declare function enums<U extends number, T extends readonly U[]>(values: T): Struct<T[number], {
[K in T[number]]: K;
}>;
export declare function enums<U extends string, T extends readonly U[]>(values: T): Struct<T[number], {
[K in T[number]]: K;
}>;
/**
* Ensure that a value is a function.
*/
export declare function func(): Struct<Function, null>;
/**
* Ensure that a value is an instance of a specific class.
*/
export declare function instance<T extends {
new (...args: any): any;
}>(Class: T): Struct<InstanceType<T>, null>;
/**
* Ensure that a value is an integer.
*/
export declare function integer(): Struct<number, null>;
/**
* Ensure that a value matches all of a set of types.
*/
export declare function intersection<A extends AnyStruct, B extends AnyStruct[]>(Structs: [A, ...B]): Struct<Infer<A> & UnionToIntersection<InferStructTuple<B>[number]>, null>;
/**
* Ensure that a value is an exact value, using `===` for comparison.
*/
export declare function literal<T extends boolean>(constant: T): Struct<T, T>;
export declare function literal<T extends number>(constant: T): Struct<T, T>;
export declare function literal<T extends string>(constant: T): Struct<T, T>;
export declare function literal<T>(constant: T): Struct<T, null>;
/**
* Ensure that a value is a `Map` object, and that its keys and values are of
* specific types.
*/
export declare function map(): Struct<Map<unknown, unknown>, null>;
export declare function map<K, V>(Key: Struct<K>, Value: Struct<V>): Struct<Map<K, V>, null>;
/**
* Ensure that no value ever passes validation.
*/
export declare function never(): Struct<never, null>;
/**
* Augment an existing struct to allow `null` values.
*/
export declare function nullable<T, S>(struct: Struct<T, S>): Struct<T | null, S>;
/**
* Ensure that a value is a number.
*/
export declare function number(): Struct<number, null>;
/**
* Ensure that a value is an object, that is has a known set of properties,
* and that its properties are of specific types.
*
* Note: Unrecognized properties will fail validation.
*/
export declare function object(): Struct<Record<string, unknown>, null>;
export declare function object<S extends ObjectSchema>(schema: S): Struct<ObjectType<S>, S>;
/**
* Augment a struct to allow `undefined` values.
*/
export declare function optional<T, S>(struct: Struct<T, S>): Struct<T | undefined, S>;
/**
* Ensure that a value is an object with keys and values of specific types, but
* without ensuring any specific shape of properties.
*
* Like TypeScript's `Record` utility.
*/
export declare function record<K extends string, V>(Key: Struct<K>, Value: Struct<V>): Struct<Record<K, V>, null>;
/**
* Ensure that a value is a `RegExp`.
*
* Note: this does not test the value against the regular expression! For that
* you need to use the `pattern()` refinement.
*/
export declare function regexp(): Struct<RegExp, null>;
/**
* Ensure that a value is a `Set` object, and that its elements are of a
* specific type.
*/
export declare function set(): Struct<Set<unknown>, null>;
export declare function set<T>(Element: Struct<T>): Struct<Set<T>, null>;
/**
* Ensure that a value is a string.
*/
export declare function string(): Struct<string, null>;
/**
* Ensure that a value is a tuple of a specific length, and that each of its
* elements is of a specific type.
*/
export declare function tuple<A extends AnyStruct, B extends AnyStruct[]>(Structs: [A, ...B]): Struct<[Infer<A>, ...InferStructTuple<B>], null>;
/**
* Ensure that a value has a set of known properties of specific types.
*
* Note: Unrecognized properties are allowed and untouched. This is similar to
* how TypeScript's structural typing works.
*/
export declare function type<S extends ObjectSchema>(schema: S): Struct<ObjectType<S>, S>;
/**
* Ensure that a value matches one of a set of types.
*/
export declare function union<A extends AnyStruct, B extends AnyStruct[]>(Structs: [A, ...B]): Struct<Infer<A> | InferStructTuple<B>[number], null>;
/**
* Ensure that any value passes validation, without widening its type to `any`.
*/
export declare function unknown(): Struct<unknown, null>;
//# sourceMappingURL=types.d.ts.map

1
node_modules/superstruct/dist/structs/types.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/structs/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,EACL,YAAY,EACZ,UAAU,EAKV,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAa,CAAA;AAEpB;;GAEG;AAEH,wBAAgB,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAEvC;AAED;;;;;;GAMG;AAEH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC/E,wBAAgB,KAAK,IAAI,MAAM,CAAC,OAAO,E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AC9D,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GACjB,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAyBlD;AAED;;;;;GAKG;AAEH,wBAAgB,IAAI,CAAC,CAAC,SAAS,YAAY,EACzC,MAAM,EAAE,CAAC,GACR,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAsB1B;AAED;;GAEG;AAEH,wBAAgB,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,EAAE,EAC9D,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GACjB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CA4CtD;AAED;;GAEG;AAEH,wBAAgB,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAE/C"}

66
node_modules/superstruct/dist/structs/utilities.d.ts generated vendored Normal file
View File

@@ -0,0 +1,66 @@
import { Context, Struct, Validator } from '../struct.js';
import { Assign, ObjectSchema, ObjectType, PartialObjectSchema } from '../utils.js';
/**
* Create a new struct that combines the properties properties from multiple
* object or type structs. Its return type will match the first parameter's type.
*
* Like JavaScript's `Object.assign` utility.
*/
export declare function assign<A extends ObjectSchema, B extends ObjectSchema>(A: Struct<ObjectType<A>, A>, B: Struct<ObjectType<B>, B>): Struct<ObjectType<Assign<A, B>>, Assign<A, B>>;
export declare function assign<A extends ObjectSchema, B extends ObjectSchema, C extends ObjectSchema>(A: Struct<ObjectType<A>, A>, B: Struct<ObjectType<B>, B>, C: Struct<ObjectType<C>, C>): Struct<ObjectType<Assign<Assign<A, B>, C>>, Assign<Assign<A, B>, C>>;
export declare function assign<A extends ObjectSchema, B extends ObjectSchema, C extends ObjectSchema, D extends ObjectSchema>(A: Struct<ObjectType<A>, A>, B: Struct<ObjectType<B>, B>, C: Struct<ObjectType<C>, C>, D: Struct<ObjectType<D>, D>): Struct<ObjectType<Assign<Assign<Assign<A, B>, C>, D>>, Assign<Assign<Assign<A, B>, C>, D>>;
export declare function assign<A extends ObjectSchema, B extends ObjectSchema, C extends ObjectSchema, D extends ObjectSchema, E extends ObjectSchema>(A: Struct<ObjectType<A>, A>, B: Struct<ObjectType<B>, B>, C: Struct<ObjectType<C>, C>, D: Struct<ObjectType<D>, D>, E: Struct<ObjectType<E>, E>): Struct<ObjectType<Assign<Assign<Assign<Assign<A, B>, C>, D>, E>>, Assign<Assign<Assign<Assign<A, B>, C>, D>, E>>;
/**
* Define a new struct type with a custom validation function.
*/
export declare function define<T>(name: string, validator: Validator): Struct<T, null>;
/**
* Create a new struct based on an existing struct, but the value is allowed to
* be `undefined`. `log` will be called if the value is not `undefined`.
*/
export declare function deprecated<T>(struct: Struct<T>, log: (value: unknown, ctx: Context) => void): Struct<T>;
/**
* Create a struct with dynamic validation logic.
*
* The callback will receive the value currently being validated, and must
* return a struct object to validate it with. This can be useful to model
* validation logic that changes based on its input.
*/
export declare function dynamic<T>(fn: (value: unknown, ctx: Context) => Struct<T, any>): Struct<T, null>;
/**
* Create a struct with lazily evaluated validation logic.
*
* The first time validation is run with the struct, the callback will be called
* and must return a struct object to use. This is useful for cases where you
* want to have self-referential structs for nested data structures to avoid a
* circular definition problem.
*/
export declare function lazy<T>(fn: () => Struct<T, any>): Struct<T, null>;
/**
* Create a new struct based on an existing object struct, but excluding
* specific properties.
*
* Like TypeScript's `Omit` utility.
*/
export declare function omit<S extends ObjectSchema, K extends keyof S>(struct: Struct<ObjectType<S>, S>, keys: K[]): Struct<ObjectType<Omit<S, K>>, Omit<S, K>>;
/**
* Create a new struct based on an existing object struct, but with all of its
* properties allowed to be `undefined`.
*
* Like TypeScript's `Partial` utility.
*/
export declare function partial<S extends ObjectSchema>(struct: Struct<ObjectType<S>, S> | S): Struct<ObjectType<PartialObjectSchema<S>>, PartialObjectSchema<S>>;
/**
* Create a new struct based on an existing object struct, but only including
* specific properties.
*
* Like TypeScript's `Pick` utility.
*/
export declare function pick<S extends ObjectSchema, K extends keyof S>(struct: Struct<ObjectType<S>, S>, keys: K[]): Struct<ObjectType<Pick<S, K>>, Pick<S, K>>;
/**
* Define a new struct type with a custom validation function.
*
* @deprecated This function has been renamed to `define`.
*/
export declare function struct<T>(name: string, validator: Validator): Struct<T, null>;
//# sourceMappingURL=utilities.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/structs/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,mBAAmB,EACpB,MAAM,aAAa,CAAA;AAGpB;;;;;GAKG;AAEH,wBAAgB,MAAM,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,YAAY,EACnE,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACjD,wBAAgB,MAAM,CACpB,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,YAAY,EAEtB,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EA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,SAAS,MAAM,CAAC,EAC5D,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAChC,IAAI,EAAE,CAAC,EAAE,GACR,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAc5C;AAED;;;;;GAKG;AAEH,wBAAgB,OAAO,CAAC,CAAC,SAAS,YAAY,EAC5C,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GACnC,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAapE;AAED;;;;;GAKG;AAEH,wBAAgB,IAAI,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,CAAC,EAC5D,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAChC,IAAI,EAAE,CAAC,EAAE,GACR,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAe5C;AAED;;;;GAIG;AAEH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAM7E"}

144
node_modules/superstruct/dist/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,144 @@
import { Struct, Infer, Result, Context, Describe } from './struct.js';
import { Failure } from './error.js';
/**
* Check if a value is a plain object.
*/
export declare function isObject(x: unknown): x is object;
/**
* Check if a value is a non-array object.
*/
export declare function isNonArrayObject(x: unknown): x is object;
/**
* Check if a value is a plain object.
*/
export declare function isPlainObject(x: unknown): x is {
[key: string]: any;
};
/**
* Return a value as a printable string.
*/
export declare function print(value: any): string;
/**
* Shifts (removes and returns) the first value from the `input` iterator.
* Like `Array.prototype.shift()` but for an `Iterator`.
*/
export declare function shiftIterator<T>(input: Iterator<T>): T | undefined;
/**
* Convert a single validation result to a failure.
*/
export declare function toFailure<T, S>(result: string | boolean | Partial<Failure>, context: Context, struct: Struct<T, S>, value: any): Failure | undefined;
/**
* Convert a validation result to an iterable of failures.
*/
export declare function toFailures<T, S>(result: Result, context: Context, struct: Struct<T, S>, value: any): IterableIterator<Failure>;
/**
* Check a value against a struct, traversing deeply into nested values, and
* returning an iterator of failures or success.
*/
export declare function run<T, S>(value: unknown, struct: Struct<T, S>, options?: {
path?: any[];
branch?: any[];
coerce?: boolean;
mask?: boolean;
message?: string;
}): IterableIterator<[Failure, undefined] | [undefined, T]>;
/**
* Convert a union of type to an intersection.
*/
export type UnionToIntersection<U> = (U extends any ? (arg: U) => any : never) extends (arg: infer I) => void ? I : never;
/**
* Assign properties from one type to another, overwriting existing.
*/
export type Assign<T, U> = Simplify<U & Omit<T, keyof U>>;
/**
* A schema for enum structs.
*/
export type EnumSchema<T extends string | number | undefined | null> = {
[K in NonNullable<T>]: K;
};
/**
* Check if a type is a match for another whilst treating overlapping
* unions as a match.
*/
export type IsMatch<T, G> = T extends G ? (G extends T ? T : never) : never;
/**
* Check if a type is an exact match.
*/
export type IsExactMatch<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? T : never;
/**
* Check if a type is a record type.
*/
export type IsRecord<T> = T extends object ? string extends keyof T ? T : never : never;
/**
* Check if a type is a tuple.
*/
export type IsTuple<T> = T extends [any] ? T : T extends [any, any] ? T : T extends [any, any, any] ? T : T extends [any, any, any, any] ? T : T extends [any, any, any, any, any] ? T : never;
/**
* Check if a type is a union.
*/
export type IsUnion<T, U extends T = T> = (T extends any ? (U extends T ? false : true) : false) extends false ? never : T;
/**
* A schema for object structs.
*/
export type ObjectSchema = Record<string, Struct<any, any>>;
/**
* Infer a type from an object struct schema.
*/
export type ObjectType<S extends ObjectSchema> = Simplify<Optionalize<{
[K in keyof S]: Infer<S[K]>;
}>>;
/**
* Omit properties from a type that extend from a specific type.
*/
export type OmitBy<T, V> = Omit<T, {
[K in keyof T]: V extends Extract<T[K], V> ? K : never;
}[keyof T]>;
/**
* Normalize properties of a type that allow `undefined` to make them optional.
*/
export type Optionalize<S extends object> = OmitBy<S, undefined> & Partial<PickBy<S, undefined>>;
/**
* Transform an object schema type to represent a partial.
*/
export type PartialObjectSchema<S extends ObjectSchema> = {
[K in keyof S]: Struct<Infer<S[K]> | undefined>;
};
/**
* Pick properties from a type that extend from a specific type.
*/
export type PickBy<T, V> = Pick<T, {
[K in keyof T]: V extends Extract<T[K], V> ? K : never;
}[keyof T]>;
/**
* Simplifies a type definition to its most basic representation.
*/
export type Simplify<T> = T extends any[] | Date ? T : {
[K in keyof T]: T[K];
} & {};
export type If<B extends Boolean, Then, Else> = B extends true ? Then : Else;
/**
* A schema for any type of struct.
*/
export type StructSchema<T> = [T] extends [string | undefined | null] ? [T] extends [IsMatch<T, string | undefined | null>] ? null : [T] extends [IsUnion<T>] ? EnumSchema<T> : T : [T] extends [number | undefined | null] ? [T] extends [IsMatch<T, number | undefined | null>] ? null : [T] extends [IsUnion<T>] ? EnumSchema<T> : T : [T] extends [boolean] ? [T] extends [IsExactMatch<T, boolean>] ? null : T : T extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : T extends Array<infer E> ? T extends IsTuple<T> ? null : Struct<E> : T extends object ? T extends IsRecord<T> ? null : {
[K in keyof T]: Describe<T[K]>;
} : null;
/**
* A schema for tuple structs.
*/
export type TupleSchema<T> = {
[K in keyof T]: Struct<T[K]>;
};
/**
* Shorthand type for matching any `Struct`.
*/
export type AnyStruct = Struct<any, any>;
/**
* Infer a tuple of types from a tuple of `Struct`s.
*
* This is used to recursively retrieve the type from `union` `intersection` and
* `tuple` structs.
*/
export type InferStructTuple<Tuple extends AnyStruct[], Length extends number = Tuple['length']> = Length extends Length ? number extends Length ? Tuple : _InferTuple<Tuple, Length, []> : never;
type _InferTuple<Tuple extends AnyStruct[], Length extends number, Accumulated extends unknown[], Index extends number = Accumulated['length']> = Index extends Length ? Accumulated : _InferTuple<Tuple, Length, [...Accumulated, Infer<Tuple[Index]>]>;
export {};
//# sourceMappingURL=utils.d.ts.map

1
node_modules/superstruct/dist/utils.d.ts.map generated vendored Normal file

File diff suppressed because one or more lines are too long