<A>(key: string): (ast: AST) => A | undefinedReturns a single annotation value by key from the AST node.
Details
Like resolve, reads from the last check's annotations when checks
are present. Returns undefined if the key is not found.
annotationsresolve
Source effect/SchemaAST.ts:38161 lines
export const const resolveAt: <A>(
key: string
) => (ast: AST) => A | undefined
Returns a single annotation value by key from the AST node.
Details
Like
resolve
, reads from the last check's annotations when checks
are present. Returns undefined if the key is not found.
resolveAt: <function (type parameter) A in <A>(key: string): (ast: AST) => A | undefinedA>(key: stringkey: string) => (ast: ASTast: type AST =
| Declaration
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union<AST>
| Suspend
Discriminated union of all AST node types.
Details
Every Schema has an .ast property of this type. Use the guard functions
(
isString
,
isObjects
, etc.) to narrow to a specific variant,
then access variant-specific fields.
- All variants share the
Base
fields:
annotations, checks,
encoding, context.
- Discriminate on the
_tag field (e.g. "String", "Objects", "Union").
AST) => function (type parameter) A in <A>(key: string): (ast: AST) => A | undefinedA | undefined = import InternalAnnotationsInternalAnnotations.function resolveAt<A>(
key: string
): (ast: SchemaAST.AST) => A | undefined
resolveAt