error: Uncaught (in promise) Error: Syntax error on line 3: The record has 1 fields, but the header has 2 fields
throw new Error(
^
at convertRowToObject (https://jsr.io/@std/csv/1.0.5/_io.ts:233:11)
at CsvParseStream.#pull (https://jsr.io/@std/csv/1.0.5/parse_stream.ts:460:28)
Describe the bug
According to
fieldsPerRecorddocumentation, I should be able to parse CSV with variable length records. I can successfully do so but not when I useskipFirstRowand/orcolumns.working example
Steps to Reproduce
Create a script with the contents of any of the following examples
not working with
skipFirstRownot working with
columnsnot working with
skipFirstRowandcolumnsExecute the script with
deno runSee error:
Expected behavior
Record<T, string | undefined>orPartial<Record<T, string>>should be used instead ofRecord<T, string>Environment