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

Function replaceChecks

packages/effect/src/SchemaAST.ts:4410–4418  ·  view source on GitHub ↗
(ast: A, checks: Checks | undefined)

Source from the content-addressed store, hash-verified

4408
4409/** @internal */
4410export function replaceChecks<A extends AST>(ast: A, checks: Checks | undefined): A {
4411 if (ast._tag === "Suspend" && checks) {
4412 throw new Error("Cannot add checks to Suspend")
4413 }
4414 if (ast.checks === checks) {
4415 return ast
4416 }
4417 return copy(ast, { checks })
4418}
4419
4420/** @internal */
4421export function appendChecks<A extends AST>(ast: A, checks: Checks | undefined): A {

Callers 2

annotateFunction · 0.85
appendChecksFunction · 0.85

Calls 1

copyFunction · 0.70

Tested by

no test coverage detected