UndefinedAST node matching the undefined value.
Details
Parsing succeeds only when the input is exactly undefined.
Source effect/SchemaAST.ts:75515 lines
export class class Undefinedclass Undefined {
_tag: 'Undefined';
getParser: () => SchemaParser.Parser;
toCodecJson: () => AST;
getExpected: () => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
AST node matching the undefined value.
Details
Parsing succeeds only when the input is exactly undefined.
Undefined extends class BaseRepresents the abstract base class for all
AST
node variants.
Details
Every AST node extends Base and inherits these fields:
annotations — user-supplied metadata (identifier, title, description,
arbitrary keys).
checks — optional
Checks
for post-type-match validation.
encoding — optional
Encoding
chain for type ↔ wire
transformations.
context — optional
Context
for per-property metadata.
Subclasses add a _tag discriminant and variant-specific data.
Base {
readonly Undefined._tag: "Undefined"_tag = "Undefined"
/** @internal */
Undefined.getParser(): SchemaParser.ParsergetParser() {
return function fromConst<T>(
ast: AST,
value: T
): SchemaParser.Parser
fromConst(this, var undefinedundefined)
}
/** @internal */
Undefined.toCodecJson(): ASTtoCodecJson(): 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 {
return function replaceEncoding<A extends AST>(
ast: A,
encoding: Encoding | undefined
): A
replaceEncoding(this, [const undefinedToNull: Linkconst undefinedToNull: {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
undefinedToNull])
}
/** @internal */
Undefined.getExpected(): stringgetExpected(): string {
return "undefined"
}
}Referenced by 2 symbols