Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.Symbolclasseffect/SchemaAST.ts:1476
Symbol

AST node matching any symbol value.

When to use

Use when you need the AST node class for schemas that match any JavaScript symbol value.

Details

When serialized to a string-based codec, symbols are converted via Symbol.keyFor and must be registered with Symbol.for.

export class Symbol extends Base {
  readonly _tag = "Symbol"
  /** @internal */
  getParser() {
    return fromRefinement(this, Predicate.isSymbol)
  }
  /** @internal */
  matchKey(s: symbol, options: ParseOptions): symbol | undefined {
    return applyTemplateLiteralPartChecks(this, s, options)
  }
  /** @internal */
  toCodecStringTree(): AST {
    return replaceEncoding(this, [symbolToString])
  }
  /** @internal */
  getExpected(): string {
    return "symbol"
  }
}
Referenced by 3 symbols