(ast: A, annotations: Schema.Annotations.Key<unknown>)
| 3502 | |
| 3503 | /** @internal */ |
| 3504 | export function annotateKey<A extends AST>(ast: A, annotations: Schema.Annotations.Key<unknown>): A { |
| 3505 | const context = ast.context ? |
| 3506 | new Context( |
| 3507 | ast.context.isOptional, |
| 3508 | ast.context.isMutable, |
| 3509 | ast.context.constructorDefault, |
| 3510 | { ...ast.context.annotations, ...annotations } |
| 3511 | ) : |
| 3512 | new Context(false, false, undefined, annotations) |
| 3513 | return replaceContext(ast, context) |
| 3514 | } |
| 3515 | |
| 3516 | /** @internal */ |
| 3517 | export const optionalKey: <A extends AST>(ast: A) => A = memoizeIdempotent(<A extends AST>(ast: A): A => { |
nothing calls this directly
no test coverage detected