Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.Voidclasseffect/SchemaAST.ts:815
Void

AST node matching TypeScript void return-value semantics.

When to use

Use when you need an AST node for a value whose result is intentionally ignored.

Details

Parsers built from this node accept any present runtime input and map it to undefined. Public schemas built from it may still expose void as their typed decoded and encoded representation.

modelsundefinedvoid_isVoid
export class Void extends Base {
  readonly _tag = "Void"
  /** @internal */
  getParser() {
    return fromAnyToConst(undefined)
  }
  /** @internal */
  toCodecJson(): AST {
    return replaceEncoding(this, [undefinedToNull])
  }
  /** @internal */
  getExpected(): string {
    return "void"
  }
}
Referenced by 2 symbols