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

Function annotateKey

packages/effect/src/SchemaAST.ts:4549–4557  ·  view source on GitHub ↗
(ast: A, annotations: Schema.Annotations.Key<unknown>)

Source from the content-addressed store, hash-verified

4547
4548/** @internal */
4549export function annotateKey<A extends AST>(ast: A, annotations: Schema.Annotations.Key<unknown>): A {
4550 return updateContext(
4551 ast,
4552 undefined,
4553 undefined,
4554 undefined,
4555 ast.context ? { ...ast.context.annotations, ...annotations } : annotations
4556 )
4557}
4558
4559/** @internal */
4560export const optionalKey: <A extends AST>(ast: A) => A = setContextFlag("isOptional")

Callers

nothing calls this directly

Calls 1

updateContextFunction · 0.85

Tested by

no test coverage detected