kkrpc
    Preparing search index...

    Function extractValidators

    • Walk a defineAPI() result and collect ~validators metadata from defineMethod() handlers into an RPCValidators-shaped object.

      For each key in the API object:

      • If it's a function with ~validators metadata → extract the schemas
      • If it's a plain object (namespace) → recurse into it
      • If it's a Standard Schema object (has ~standard) → skip it (this prevents treating schema objects as namespace nodes)
      • Plain functions without metadata are skipped (no validation for them)

      The result can be passed directly to RPCChannel's validators option.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • api: T

      Returns Record<string, unknown>