kkrpc
    Preparing search index...

    Function runValidation

    • Execute a Standard Schema validator against a value.

      Calls schema["~standard"].validate(value) per the Standard Schema spec. The spec requires validate() to return a Result object (never throw), but we wrap in try-catch defensively in case a non-conforming validator throws unexpectedly.

      Parameters

      • schema: undefined | StandardSchemaV1<unknown, unknown>

        A Standard Schema instance (e.g. a Zod schema), or undefined to skip

      • value: unknown

        The value to validate (args tuple for input, return value for output)

      Returns Promise<
          | { success: true; value: unknown }
          | { issues: readonly Issue[]; success: false },
      >

      { success: true, value } if valid (value may be transformed/coerced by the schema), or { success: false, issues } with structured validation issues