Stone.js API
    Preparing search index...

    The engine-agnostic schema contract every validator speaks.

    Any object exposing a validate(data) method that returns a ValidationResult is a valid Stone.js schema. Zod, Valibot and ArkType schemas are adapted to this shape (they all implement the Standard Schema spec, or expose safeParse), so you write the schema once and use it identically on the backend and the frontend.

    interface NativeSchema<T = unknown> {
        validate: (data: unknown) => ValidationResult<T>;
    }

    Type Parameters

    • T = unknown
    Index
    validate: (data: unknown) => ValidationResult<T>

    Validate a value, returning a normalised result.