<S extends Top>(
checks_0: SchemaAST.Check<S["Type"]>,
...checks: Array<SchemaAST.Check<S["Type"]>>
): (self: S) => S["Rebuild"]Attaches one or more filter checks to a schema without changing the TypeScript type.
Example (Adding checks to a schema)
import { Schema } from "effect"
const AgeSchema = Schema.Number.pipe(
Schema.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(120))
)filtering
Source effect/Schema.ts:50135 lines
export function function check<S extends Top>(
checks_0: SchemaAST.Check<S["Type"]>,
...checks: Array<SchemaAST.Check<S["Type"]>>
): (self: S) => S["Rebuild"]
Attaches one or more filter checks to a schema without changing the
TypeScript type.
Example (Adding checks to a schema)
import { Schema } from "effect"
const AgeSchema = Schema.Number.pipe(
Schema.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(120))
)
check<function (type parameter) S in check<S extends Top>(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): (self: S) => S["Rebuild"]S extends Top>(
...checks: readonly [
SchemaAST.Check<S["Type"]>,
...Array<SchemaAST.Check<S["Type"]>>
]
(parameter) checks: {
0: SchemaAST.Check<S['Type']>;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<SchemaAST.Check<S['Type']>>>): Array<SchemaAST.Check<S['Type']>>; (...items: Array<SchemaAST.Check<S['Type']> | ConcatArray<SchemaAST.Check<S['Type']>>>): Array<SchemaAST.Check<S['Type']>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<SchemaAST.Check<S['Type']>>;
indexOf: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => number;
lastIndexOf: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => number;
every: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: R…;
some: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray…;
reduce: { (callbackfn: (previousValue: SchemaAST.Check<S['Type']>, currentValue: SchemaAST.Check<S['Type']>, currentIndex: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => SchemaAST.Check<S['Type']>): SchemaAST.Check<S['Type']>; (callb…;
reduceRight: { (callbackfn: (previousValue: SchemaAST.Check<S['Type']>, currentValue: SchemaAST.Check<S['Type']>, currentIndex: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => SchemaAST.Check<S['Type']>): SchemaAST.Check<S['Type']>; (callb…;
find: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArra…;
findIndex: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, SchemaAST.Check<S['Type']>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<SchemaAST.Check<S['Type']>>;
includes: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: SchemaAST.Check<S['Type']>, index: number, array: Array<SchemaAST.Check<S['Type']>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => SchemaAST.Check<S['Type']> | undefined;
findLast: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: Readonly…;
findLastIndex: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<SchemaAST.Check<S['Type']>>;
toSorted: (compareFn?: ((a: SchemaAST.Check<S['Type']>, b: SchemaAST.Check<S['Type']>) => number) | undefined) => Array<SchemaAST.Check<S['Type']>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<SchemaAST.Check<S['Type']>>): Array<SchemaAST.Check<S['Type']>>; (start: number, deleteCount?: number): Array<SchemaAST.Check<S['Type']>> };
with: (index: number, value: SchemaAST.Check<S['Type']>) => Array<SchemaAST.Check<S['Type']>>;
}
checks: readonly [import SchemaASTSchemaAST.type Check<T> =
| SchemaAST.Filter<T>
| SchemaAST.FilterGroup<T>
Check<function (type parameter) S in check<S extends Top>(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): (self: S) => S["Rebuild"]S["Type"]>, ...interface Array<T>Array<import SchemaASTSchemaAST.type Check<T> =
| SchemaAST.Filter<T>
| SchemaAST.FilterGroup<T>
Check<function (type parameter) S in check<S extends Top>(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): (self: S) => S["Rebuild"]S["Type"]>>]
) {
return (self: S extends Topself: function (type parameter) S in check<S extends Top>(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): (self: S) => S["Rebuild"]S): function (type parameter) S in check<S extends Top>(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): (self: S) => S["Rebuild"]S["Rebuild"] => self: S extends Topself.Bottom<unknown, unknown, unknown, unknown, AST, Top, unknown, unknown, any, unknown, Mutability, Optionality, ConstructorDefault, Mutability, Optionality>.check(checks_0: SchemaAST.Check<S["Type"]>, ...checks: SchemaAST.Check<S["Type"]>[]): S["Rebuild"]check(...checks: readonly [
SchemaAST.Check<S["Type"]>,
...Array<SchemaAST.Check<S["Type"]>>
]
(parameter) checks: {
0: SchemaAST.Check<S['Type']>;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<SchemaAST.Check<S['Type']>>>): Array<SchemaAST.Check<S['Type']>>; (...items: Array<SchemaAST.Check<S['Type']> | ConcatArray<SchemaAST.Check<S['Type']>>>): Array<SchemaAST.Check<S['Type']>> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<SchemaAST.Check<S['Type']>>;
indexOf: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => number;
lastIndexOf: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => number;
every: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: R…;
some: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray…;
reduce: { (callbackfn: (previousValue: SchemaAST.Check<S['Type']>, currentValue: SchemaAST.Check<S['Type']>, currentIndex: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => SchemaAST.Check<S['Type']>): SchemaAST.Check<S['Type']>; (callb…;
reduceRight: { (callbackfn: (previousValue: SchemaAST.Check<S['Type']>, currentValue: SchemaAST.Check<S['Type']>, currentIndex: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => SchemaAST.Check<S['Type']>): SchemaAST.Check<S['Type']>; (callb…;
find: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArra…;
findIndex: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, obj: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, SchemaAST.Check<S['Type']>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<SchemaAST.Check<S['Type']>>;
includes: (searchElement: SchemaAST.Check<S['Type']>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: SchemaAST.Check<S['Type']>, index: number, array: Array<SchemaAST.Check<S['Type']>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => SchemaAST.Check<S['Type']> | undefined;
findLast: { (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: Readonly…;
findLastIndex: (predicate: (value: SchemaAST.Check<S['Type']>, index: number, array: ReadonlyArray<SchemaAST.Check<S['Type']>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<SchemaAST.Check<S['Type']>>;
toSorted: (compareFn?: ((a: SchemaAST.Check<S['Type']>, b: SchemaAST.Check<S['Type']>) => number) | undefined) => Array<SchemaAST.Check<S['Type']>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<SchemaAST.Check<S['Type']>>): Array<SchemaAST.Check<S['Type']>>; (start: number, deleteCount?: number): Array<SchemaAST.Check<S['Type']>> };
with: (index: number, value: SchemaAST.Check<S['Type']>) => Array<SchemaAST.Check<S['Type']>>;
}
checks)
}