Stone.js API
    Preparing search index...
    • Validates several event inputs at once against their schemas.

      For each [key, schema] it validates event.get(key) and collects every issue (each issue's path is prefixed with its key). If any input fails, it throws a single ValidationError carrying all the issues — so the caller sees the full picture, not just the first failure.

      Platform-agnostic: the event only needs a get(key) method, so it works for HTTP, CLI, browser or any other context.

      Returns the parsed values, keyed as the rules were. A schema does not only accept or reject, it coerces and strips: z.coerce.number() turns "42" into 42, and a strict object drops the keys you did not declare. Throwing the parsed value away and reading the raw input again is how an application ends up validating one value and using another.

      Parameters

      • event: ReadableEvent

        The incoming event (anything with get).

      • rules: ValidationRules

        The validation rules.

      • validator: IValidator = ...

        The validator to use (defaults to a fresh stateless one).

      Returns Record<string, unknown>

      The parsed value for each rule.

      When any input fails validation.