Stone.js API
    Preparing search index...

    The validation service.

    Platform-agnostic: it validates any value against any supported schema (Zod, Valibot, ArkType via Standard Schema, or a native Stone.js schema) and knows nothing about HTTP/CLI/browser. Register it in the container (see ValidationServiceProvider) and resolve it as validator, or use the same schema directly on the frontend — one schema, both sides.

    Implements

    Index
    • Validate data and return the parsed value, or throw a ValidationError on failure.

      Type Parameters

      • T

      Parameters

      • schema: SchemaInput<T>

        The schema.

      • data: unknown

        The value to validate.

      Returns T

      The parsed value.

      When validation fails.

    • Whether data satisfies schema.

      Type Parameters

      • T

      Parameters

      • schema: SchemaInput<T>

        The schema.

      • data: unknown

        The value to validate.

      Returns boolean

      True when valid.