effect-io-ai

Package: effect
Module: SchemaAST

SchemaAST.Literal

AST node matching an exact primitive value (string, number, boolean, or bigint).

Details

Parsing succeeds only when the input is strictly equal (===) to the stored literal. Numeric literals must be finite — Infinity, -Infinity, and NaN are rejected at construction time.

Example (Creating a literal AST)

import { SchemaAST } from "effect"

const ast = new SchemaAST.Literal("active")
console.log(ast.literal) // "active"

See

Signature

declare class Literal { constructor(
    literal: LiteralValue,
    annotations?: Schema.Annotations.Annotations,
    checks?: Checks,
    encoding?: Encoding,
    context?: Context
  ) }

Source

Since v3.10.0