Stone.js API
    Preparing search index...

    Runs a schema and reports what it said.

    This module reads schemas; it does not validate requests, own engines, or keep a registry — so it carries its own reader rather than depending on a validation module to project data. The dialects it accepts are public specifications, not one library's API: Standard Schema first, then the safeParse/parse shape, then a plain validate. An application writes its schemas once and both sides of the boundary read them.

    Substitutable: pass your own IContractChecker and this one steps aside.

    Implements

    Index
    • Run a schema against a value.

      Type Parameters

      • T

      Parameters

      • schema: unknown

        The contract.

      • data: unknown

        What the resource produced.

      Returns ContractResult<T>

      Whether it holds, the parsed value, and what failed.

      When the value is not a schema this can run, because guessing would mean projecting unchecked data while reporting success.