MCPcopy Create free account
hub / github.com/Effect-TS/effect / annotate

Function annotate

packages/effect/src/SchemaAST.ts:4402–4407  ·  view source on GitHub ↗
(ast: A, annotations: Schema.Annotations.Annotations)

Source from the content-addressed store, hash-verified

4400
4401/** @internal */
4402export function annotate<A extends AST>(ast: A, annotations: Schema.Annotations.Annotations): A {
4403 if (ast.checks) {
4404 return replaceChecks(ast, mapLast(ast.checks, (check) => check.annotate(annotations)))
4405 }
4406 return copy(ast, { annotations: { ...ast.annotations, ...annotations } })
4407}
4408
4409/** @internal */
4410export function replaceChecks<A extends AST>(ast: A, checks: Checks | undefined): A {

Callers 1

SchemaAST.tsFile · 0.70

Calls 4

replaceChecksFunction · 0.85
mapLastFunction · 0.85
copyFunction · 0.70
annotateMethod · 0.65

Tested by

no test coverage detected