MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeRefineClass

Function makeRefineClass

packages/effect/src/Schema.ts:3604–3624  ·  view source on GitHub ↗
(
  from: From,
  filter: (a: Schema.Type<From>, options: ParseOptions, self: AST.Refinement) => option_.Option<ParseResult.ParseIssue>,
  ast: AST.AST
)

Source from the content-addressed store, hash-verified

3602}
3603
3604function makeRefineClass<From extends Schema.Any, A>(
3605 from: From,
3606 filter: (a: Schema.Type<From>, options: ParseOptions, self: AST.Refinement) => option_.Option<ParseResult.ParseIssue>,
3607 ast: AST.AST
3608): refine<A, From> {
3609 return class RefineClass extends make<A, Schema.Encoded<From>, Schema.Context<From>>(ast) {
3610 static override annotations(annotations: Annotations.Schema<A>): refine<A, From> {
3611 return makeRefineClass(this.from, this.filter, mergeSchemaAnnotations(this.ast, annotations))
3612 }
3613
3614 static [RefineSchemaId] = from
3615
3616 static from = from
3617
3618 static filter = filter
3619
3620 static make = (a: Schema.Type<From>, options?: MakeOptions): A => {
3621 return getDisableValidationMakeOption(options) ? a : ParseResult.validateSync(this)(a)
3622 }
3623 }
3624}
3625
3626/**
3627 * @category api interface

Callers 2

annotationsMethod · 0.85
filterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected