tuple

View Source

Summary

Create a schema that validates a fixed-length tuple.

Signature

function tuple<items extends Schema<any, any>[]>(
  items: items,
): Schema<
  unknown,
  { [index in string | number | symbol]: InferOutput<items[index<index>]> }
>;

Params

items

Returns

A schema that produces a typed tuple