baml.csv.decode

Eager typed parse of in-memory input.

Reference version

Signature

function baml.csv.decode<T>(
source: string | uint8array,
options: baml.csv.ReaderOptions | null = …
) -> T[] throws baml.csv.Error

Eager typed parse of in-memory input.

The in-memory counterpart of read<T>, with Record.decode<T>'s rules. The same one-shot caveat as parse applies: the reader is not returned, so skipped() is unreachable and on_skip is the only way to observe skipped rows.

Throws

  • Error for anything reader and Reader.rows<T> throw, and for any Decode failure not suppressed by on_error = "skip".

Source:<builtin>/baml/ns_csv/csv.bamlbytes 3538935732