columns
Function: columns()
Section titled “Function: 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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Spec extends readonly ( | ColumnSpec<string, unknown> | null)[] |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
valuesAt | string |
spec | Spec |
options? | DecodeColumnsOptions |
Returns
Section titled “Returns”CustomProducer<{ [K in string]: { [S in ColumnSpec<string, unknown> as S["name"]]: ReturnType<S["parse"]> }[K] }[]>