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

Function replaceChecks

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

Source from the content-addressed store, hash-verified

3384
3385/** @internal */
3386export function replaceChecks<A extends AST>(ast: A, checks: Checks | undefined): A {
3387 if (ast._tag === "Suspend" && checks) {
3388 throw new Error("Cannot add checks to Suspend")
3389 }
3390 if (ast.checks === checks) {
3391 return ast
3392 }
3393 return modifyOwnPropertyDescriptors(ast, (d) => {
3394 d.checks.value = checks
3395 })
3396}
3397
3398/** @internal */
3399export function appendChecks<A extends AST>(ast: A, checks: Checks | undefined): A {

Callers 2

annotateFunction · 0.85
appendChecksFunction · 0.85

Calls 1

Tested by

no test coverage detected