toTaggedUnion<Tag, Members>Augments an existing Union of tagged structs with utility methods keyed by the discriminant field.
Example (Adding tagged-union utilities to an existing union)
import { Schema } from "effect"
const A = Schema.TaggedStruct("A", { value: Schema.Number })
const B = Schema.TaggedStruct("B", { name: Schema.String })
const MyUnion = Schema.Union([A, B]).pipe(Schema.toTaggedUnion("_tag"))
// Pattern-match on the union
const result = MyUnion.match({ _tag: "A", value: 1 }, {
A: (a) => `number: ${a.value}`,
B: (b) => `name: ${b.name}`
})export type type toTaggedUnion<
Tag extends PropertyKey,
Members extends ReadonlyArray<
Constraint & {
readonly Type: {
readonly [K in Tag]: PropertyKey
}
}
>
> = Union<Members> &
TaggedUnionUtils<Tag, Members, Flatten<Members>>
Augments an existing
Union
of tagged structs with utility methods keyed by the discriminant field.
Example (Adding tagged-union utilities to an existing union)
import { Schema } from "effect"
const A = Schema.TaggedStruct("A", { value: Schema.Number })
const B = Schema.TaggedStruct("B", { name: Schema.String })
const MyUnion = Schema.Union([A, B]).pipe(Schema.toTaggedUnion("_tag"))
// Pattern-match on the union
const result = MyUnion.match({ _tag: "A", value: 1 }, {
A: (a) => `number: ${a.value}`,
B: (b) => `name: ${b.name}`
})
Type-level representation returned by
toTaggedUnion
.
toTaggedUnion<
function (type parameter) Tag in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Tag extends type PropertyKey =
| string
| number
| symbol
PropertyKey,
function (type parameter) Members in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Members extends interface ReadonlyArray<T>ReadonlyArray<Constraint & { readonly type Type: { readonly [K in Tag]: PropertyKey }Type: { readonly [function (type parameter) KK in function (type parameter) Tag in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Tag]: type PropertyKey =
| string
| number
| symbol
PropertyKey } }>
> = interface Union<Members extends ReadonlyArray<Constraint>>Creates a union schema from an array of member schemas. Members are tested in
order; the first match is returned.
Details
Optionally, specify mode:
"anyOf" (default) — matches if any member matches.
"oneOf" — matches if exactly one member matches.
Example (Defining a string or number union)
import { Schema } from "effect"
const schema = Schema.Union([Schema.String, Schema.Number])
Schema.decodeUnknownSync(schema)("hello") // "hello"
Schema.decodeUnknownSync(schema)(42) // 42
Type-level representation returned by
Union
.
Union<function (type parameter) Members in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Members> & type TaggedUnionUtils<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>, Flattened extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }> = Flatten<...>> = {
readonly cases: Simplify<{ [M in Flattened[number] as M["Type"][Tag]]: M; }>;
readonly isAnyOf: <const Keys>(keys: ReadonlyArray<Keys>) => (value: Members[number]["Type"]) => value is Extract<Members[number]["Type"], { readonly [K in Tag]: Keys; }>;
readonly guards: { [M in Flattened[number] as M["Type"][Tag]]: (u: unknown) => u is M["Type"]; };
readonly match: {
<Cases extends { [M in Flattened[number] as M["Type"][Tag]]: (value: M["Type"]) => any; }>(value: Members[number]["Type"], cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? Unify<R> : never;
<Cases extends { [M in Flattened[number] as M["Type"][Tag]]: (value: M["Type"]) => any; }>(cases: Cases): (value: Members[number]["Type"]) => Cases[keyof Cases] extends (value: any) => infer R ? Unify<R> : never;
};
}
TaggedUnionUtils<function (type parameter) Tag in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Tag, function (type parameter) Members in type toTaggedUnion<Tag extends PropertyKey, Members extends ReadonlyArray<Constraint & { readonly Type: { readonly [K in Tag]: PropertyKey; }; }>>Members>
/**
* Augments an existing {@link Union} of tagged structs with utility methods keyed by the discriminant field.
*
* **Example** (Adding tagged-union utilities to an existing union)
*
* ```ts
* import { Schema } from "effect"
*
* const A = Schema.TaggedStruct("A", { value: Schema.Number })
* const B = Schema.TaggedStruct("B", { name: Schema.String })
*
* const MyUnion = Schema.Union([A, B]).pipe(Schema.toTaggedUnion("_tag"))
*
* // Pattern-match on the union
* const result = MyUnion.match({ _tag: "A", value: 1 }, {
* A: (a) => `number: ${a.value}`,
* B: (b) => `name: ${b.name}`
* })
* ```
*
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
* @category combinators
* @since 4.0.0
*/
export function function toTaggedUnion<
Tag extends PropertyKey
>(
tag: Tag
): <
Members extends ReadonlyArray<
Constraint & {
readonly Type: {
readonly [K in Tag]: PropertyKey
}
}
>
>(
self: Union<Members>
) => toTaggedUnion<Tag, Members>
Augments an existing
Union
of tagged structs with utility methods keyed by the discriminant field.
Example (Adding tagged-union utilities to an existing union)
import { Schema } from "effect"
const A = Schema.TaggedStruct("A", { value: Schema.Number })
const B = Schema.TaggedStruct("B", { name: Schema.String })
const MyUnion = Schema.Union([A, B]).pipe(Schema.toTaggedUnion("_tag"))
// Pattern-match on the union
const result = MyUnion.match({ _tag: "A", value: 1 }, {
A: (a) => `number: ${a.value}`,
B: (b) => `name: ${b.name}`
})
toTaggedUnion<const function (type parameter) Tag in toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>) => toTaggedUnion<Tag, Members>
Tag extends type PropertyKey =
| string
| number
| symbol
PropertyKey>(tag: const Tag extends PropertyKeytag: function (type parameter) Tag in toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>) => toTaggedUnion<Tag, Members>
Tag) {
return <const function (type parameter) Members in <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>): toTaggedUnion<Tag, Members>
Members extends interface ReadonlyArray<T>ReadonlyArray<Constraint & { readonly type Type: { readonly [K in Tag]: PropertyKey }Type: { readonly [function (type parameter) KK in function (type parameter) Tag in toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>) => toTaggedUnion<Tag, Members>
Tag]: type PropertyKey =
| string
| number
| symbol
PropertyKey } }>>(
self: Union<Members>(parameter) self: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: Members) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Annotations.Bottom<{ [K in keyof Members]: Members[K]['Type']; }[number], readonly []>) => Union<Members>;
annotateKey: (annotations: Annotations.Key<{ [K in keyof Members]: Members[K]['Type']; }[number]>) => Union<Members>;
check: (checks_0: SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>, ...checks: Array<SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>>) => Union<Members>;
rebuild: (ast: SchemaAST.Union<{ [K in keyof Members]: Members[K]['ast']; }[number]>) => Union<Members>;
make: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => { [K in keyof Members]: Members[K]['Type']; }[number];
makeOption: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Option_.Option<{ [K in keyof Members]: Members[K]['Type']; }[number]>;
makeEffect: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Effect.Effect<{ [K in keyof Members]: Members[K]['Type']; }[number], SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface Union<Members extends ReadonlyArray<Constraint>>Creates a union schema from an array of member schemas. Members are tested in
order; the first match is returned.
Details
Optionally, specify mode:
"anyOf" (default) — matches if any member matches.
"oneOf" — matches if exactly one member matches.
Example (Defining a string or number union)
import { Schema } from "effect"
const schema = Schema.Union([Schema.String, Schema.Number])
Schema.decodeUnknownSync(schema)("hello") // "hello"
Schema.decodeUnknownSync(schema)(42) // 42
Type-level representation returned by
Union
.
Union<function (type parameter) Members in <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>): toTaggedUnion<Tag, Members>
Members>
): type toTaggedUnion<
Tag extends PropertyKey,
Members extends ReadonlyArray<
Constraint & {
readonly Type: {
readonly [K in Tag]: PropertyKey
}
}
>
> = Union<Members> &
TaggedUnionUtils<Tag, Members, Flatten<Members>>
Augments an existing
Union
of tagged structs with utility methods keyed by the discriminant field.
Example (Adding tagged-union utilities to an existing union)
import { Schema } from "effect"
const A = Schema.TaggedStruct("A", { value: Schema.Number })
const B = Schema.TaggedStruct("B", { name: Schema.String })
const MyUnion = Schema.Union([A, B]).pipe(Schema.toTaggedUnion("_tag"))
// Pattern-match on the union
const result = MyUnion.match({ _tag: "A", value: 1 }, {
A: (a) => `number: ${a.value}`,
B: (b) => `name: ${b.name}`
})
Type-level representation returned by
toTaggedUnion
.
toTaggedUnion<function (type parameter) Tag in toTaggedUnion<const Tag extends PropertyKey>(tag: Tag): <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>) => toTaggedUnion<Tag, Members>
Tag, function (type parameter) Members in <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>): toTaggedUnion<Tag, Members>
Members> => {
const const cases: Record<PropertyKey, unknown>cases: type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<type PropertyKey =
| string
| number
| symbol
PropertyKey, unknown> = {}
const const guards: Record<
PropertyKey,
(u: unknown) => boolean
>
guards: type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<type PropertyKey =
| string
| number
| symbol
PropertyKey, (u: unknownu: unknown) => boolean> = {}
const const isAnyOf: (
keys: ReadonlyArray<PropertyKey>
) => (value: Members[number]["Type"]) => boolean
isAnyOf = (keys: readonly PropertyKey[]keys: interface ReadonlyArray<T>ReadonlyArray<type PropertyKey =
| string
| number
| symbol
PropertyKey>) => (value: Members[number]["Type"]value: function (type parameter) Members in <const Members extends ReadonlyArray<Constraint & {
readonly Type: { readonly [K in Tag]: PropertyKey; };
}>>(self: Union<Members>): toTaggedUnion<Tag, Members>
Members[number]["Type"]) => keys: readonly PropertyKey[]keys.ReadonlyArray<PropertyKey>.includes(searchElement: PropertyKey, fromIndex?: number): booleanDetermines whether an array includes a certain element, returning true or false as appropriate.
includes(value: Members[number]["Type"]value[tag: const Tag extends PropertyKeytag])
function (local function) walk(schema: Constraint): voidwalk(self: Union<Members>(parameter) self: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: Members) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Annotations.Bottom<{ [K in keyof Members]: Members[K]['Type']; }[number], readonly []>) => Union<Members>;
annotateKey: (annotations: Annotations.Key<{ [K in keyof Members]: Members[K]['Type']; }[number]>) => Union<Members>;
check: (checks_0: SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>, ...checks: Array<SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>>) => Union<Members>;
rebuild: (ast: SchemaAST.Union<{ [K in keyof Members]: Members[K]['ast']; }[number]>) => Union<Members>;
make: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => { [K in keyof Members]: Members[K]['Type']; }[number];
makeOption: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Option_.Option<{ [K in keyof Members]: Members[K]['Type']; }[number]>;
makeEffect: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Effect.Effect<{ [K in keyof Members]: Members[K]['Type']; }[number], SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self)
return var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.assign<Union<Members>, {
cases: Record<PropertyKey, unknown>;
isAnyOf: (keys: ReadonlyArray<PropertyKey>) => (value: Members[number]["Type"]) => boolean;
guards: Record<PropertyKey, (u: unknown) => boolean>;
match: () => any;
}>(target: Union<Members>, source: {
cases: Record<PropertyKey, unknown>;
isAnyOf: (keys: ReadonlyArray<PropertyKey>) => (value: Members[number]["Type"]) => boolean;
guards: Record<PropertyKey, (u: unknown) => boolean>;
match: () => any;
}): Union<...> & {
cases: Record<PropertyKey, unknown>;
isAnyOf: (keys: ReadonlyArray<PropertyKey>) => (value: Members[number]["Type"]) => boolean;
guards: Record<PropertyKey, (u: unknown) => boolean>;
match: () => any;
} (+3 overloads)
Copy the values of all of the enumerable own properties from one or more source objects to a
target object. Returns the target object.
assign(self: Union<Members>(parameter) self: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: Members) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Annotations.Bottom<{ [K in keyof Members]: Members[K]['Type']; }[number], readonly []>) => Union<Members>;
annotateKey: (annotations: Annotations.Key<{ [K in keyof Members]: Members[K]['Type']; }[number]>) => Union<Members>;
check: (checks_0: SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>, ...checks: Array<SchemaAST.Check<{ [K in keyof Members]: Members[K]['Type']; }[number]>>) => Union<Members>;
rebuild: (ast: SchemaAST.Union<{ [K in keyof Members]: Members[K]['ast']; }[number]>) => Union<Members>;
make: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => { [K in keyof Members]: Members[K]['Type']; }[number];
makeOption: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Option_.Option<{ [K in keyof Members]: Members[K]['Type']; }[number]>;
makeEffect: (input: { [K in keyof Members]: Members[K]['~type.make']; }[number], options?: MakeOptions) => Effect.Effect<{ [K in keyof Members]: Members[K]['Type']; }[number], SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self, { cases: Record<PropertyKey, unknown>cases, isAnyOf: (
keys: ReadonlyArray<PropertyKey>
) => (value: Members[number]["Type"]) => boolean
isAnyOf, guards: Record<
PropertyKey,
(u: unknown) => boolean
>
guards, match: () => anymatch }) as any
function function (local function) walk(schema: Constraint): voidwalk(schema: Constraint(parameter) schema: {
ast: SchemaAST.AST;
Type: unknown;
Encoded: unknown;
DecodingServices: unknown;
EncodingServices: unknown;
Iso: unknown;
}
schema: Constraint) {
const const ast: SchemaAST.ASTast = schema: Constraint(parameter) schema: {
ast: SchemaAST.AST;
Type: unknown;
Encoded: unknown;
DecodingServices: unknown;
EncodingServices: unknown;
Iso: unknown;
}
schema.Constraint["ast"]: SchemaAST.ASTast
if (
import SchemaASTSchemaAST.const isUnion: (
ast: AST
) => ast is Union<AST>
isUnion(const ast: SchemaAST.ASTast) && "members" in schema: Constraint(parameter) schema: {
ast: SchemaAST.AST;
Type: unknown;
Encoded: unknown;
DecodingServices: unknown;
EncodingServices: unknown;
Iso: unknown;
}
schema && module globalThisglobalThis.var Array: ArrayConstructorArray.ArrayConstructor.isArray(arg: any): arg is any[]isArray(schema: Constraintschema.members: unknownmembers) &&
schema: Constraintschema.members: any[]members.Array<any>.every<Top>(predicate: (value: any, index: number, array: any[]) => value is Top, thisArg?: any): this is S[] (+1 overload)Determines whether all the members of an array satisfy the specified test.
every(function isSchema(u: unknown): u is TopChecks whether a value is a Schema.
isSchema)
) {
return schema: Constraintschema.members: Array<Top>members.Array<Top>.forEach(callbackfn: (value: Top, index: number, array: Top[]) => void, thisArg?: any): voidPerforms the specified action for each element in an array.
forEach(function (local function) walk(schema: Constraint): voidwalk)
}
const const sentinels: SchemaAST.Sentinel[]sentinels = import SchemaASTSchemaAST.function collectSentinels(
ast: AST
): Array<Sentinel>
collectSentinels(const ast: SchemaAST.ASTast)
if (const sentinels: SchemaAST.Sentinel[]sentinels.Array<T>.length: numberGets or sets the length of the array. This is a number one higher than the highest index in the array.
length > 0) {
const const literal:
| symbol
| SchemaAST.LiteralValue
| undefined
literal = const sentinels: SchemaAST.Sentinel[]sentinels.Array<Sentinel>.find(predicate: (value: SchemaAST.Sentinel, index: number, obj: SchemaAST.Sentinel[]) => unknown, thisArg?: any): SchemaAST.Sentinel | undefined (+1 overload)Returns the value of the first element in the array where predicate is true, and undefined
otherwise.
find((s: SchemaAST.Sentinel(parameter) s: {
key: PropertyKey;
literal: LiteralValue | symbol;
}
s) => s: SchemaAST.Sentinel(parameter) s: {
key: PropertyKey;
literal: LiteralValue | symbol;
}
s.key: PropertyKeykey === tag: const Tag extends PropertyKeytag)?.literal: LiteralValue | symbolliteral
if (import PredicatePredicate.isPropertyKey(const literal:
| symbol
| SchemaAST.LiteralValue
| undefined
literal)) {
const cases: Record<PropertyKey, unknown>cases[const literal:
| symbol
| SchemaAST.LiteralValue
| undefined
literal] = schema: Constraint(parameter) schema: {
ast: SchemaAST.AST;
Type: unknown;
Encoded: unknown;
DecodingServices: unknown;
EncodingServices: unknown;
Iso: unknown;
}
schema
const guards: Record<
PropertyKey,
(u: unknown) => boolean
>
guards[const literal:
| symbol
| SchemaAST.LiteralValue
| undefined
literal] = const is: <S extends Schema.Constraint>(
schema: S
) => <I>(input: I) => input is I & S["Type"]
Creates a type guard that checks whether an input satisfies the schema's decoded
type side.
When to use
Use to build a type guard for checking the decoded side of a schema without
exposing issue details.
Details
The guard returns true on successful validation and false when validation
fails only with schema issues, without exposing issue details.
Gotchas
Only causes made entirely of schema issues are converted to false. Causes
that contain defects, interruptions, or asynchronous work at this synchronous
boundary throw an Error whose cause is the underlying Cause.
is(const toType: toTypeLambda
;<Constraint>(self: Constraint) =>
toType<Constraint>
Type-level representation returned by
toType
.
Extracts the type-side schema: sets Encoded to equal the decoded Type,
discarding the encoding transformation path.
toType(schema: Constraint(parameter) schema: {
ast: SchemaAST.AST;
Type: unknown;
Encoded: unknown;
DecodingServices: unknown;
EncodingServices: unknown;
Iso: unknown;
}
schema))
return
}
}
throw new module globalThisglobalThis.var Error: ErrorConstructor
new (message?: string, options?: globalThis.ErrorOptions) => globalThis.Error (+1 overload)
Error("No literal or unique symbol found")
}
function function (local function) match(): anymatch() {
if (function (local var) arguments: IArgumentsarguments.IArguments.length: numberlength === 1) {
const const cases: anycases = function (local var) arguments: IArgumentsarguments[0]
return function(value: anyvalue: any) {
return const cases: anycases[value: anyvalue[tag: const Tag extends PropertyKeytag]](value: anyvalue)
}
}
const const value: anyvalue = function (local var) arguments: IArgumentsarguments[0]
const const cases: anycases = function (local var) arguments: IArgumentsarguments[1]
return const cases: anycases[const value: anyvalue[tag: const Tag extends PropertyKeytag]](const value: anyvalue)
}
}
}