(ast: A, annotations: Schema.Annotations.Annotations)
| 3373 | |
| 3374 | /** @internal */ |
| 3375 | export function annotate<A extends AST>(ast: A, annotations: Schema.Annotations.Annotations): A { |
| 3376 | if (ast.checks) { |
| 3377 | const last = ast.checks[ast.checks.length - 1] |
| 3378 | return replaceChecks(ast, Arr.append(ast.checks.slice(0, -1), last.annotate(annotations))) |
| 3379 | } |
| 3380 | return modifyOwnPropertyDescriptors(ast, (d) => { |
| 3381 | d.annotations.value = { ...d.annotations.value, ...annotations } |
| 3382 | }) |
| 3383 | } |
| 3384 | |
| 3385 | /** @internal */ |
| 3386 | export function replaceChecks<A extends AST>(ast: A, checks: Checks | undefined): A { |
no test coverage detected