array
function array<T>(primitive: TypedPrimitive<T>): ArrayTypedPrimitive<T>Creates a primitive that splits a comma-separated string (or maps over a pre-split
string array) and parses each item using the provided primitive. An empty or
missing input produces an empty array.
primitive TypedPrimitive<T>
returns ArrayTypedPrimitive<T>
Example:
const tags = array(string); // ArrayTypedPrimitive<string>const ids = array(int.min(1)); // ArrayTypedPrimitive<number>Throws:
When the raw value fails this primitive’s validation.
Learn: Primitives and builders