Skip to content
A

columns

function columns<Spec>(
valuesAt,
spec,
options?
): CustomProducer<{ [K in string]: { [S in ColumnSpec<string, unknown> as S["name"]]: ReturnType<S["parse"]> }[K] }[]>;

Defined in: src/core/columns.ts:142

A Producer that reads the CSV text at valuesAt (relative to the enclosing node) and decodes it with decodeColumns. Yields [] when the values element is absent.

The row type is inferred from the (as const) spec — each column’s name and cell-parser return type — so callers no longer declare it by hand.

Type Parameter
Spec extends readonly ( | ColumnSpec<string, unknown> | null)[]
ParameterType
valuesAtstring
specSpec
options?DecodeColumnsOptions

CustomProducer<{ [K in string]: { [S in ColumnSpec<string, unknown> as S["name"]]: ReturnType<S["parse"]> }[K] }[]>