A fast, dependency-free drop-in for csv-reader 1.0.0: run(input) returns,
for {text, header}, exactly the {columns, rows, errors} csv-reader
returns — including its broken-row policy (BOM drop, LF/CRLF record ends,
stray CRs, quoted fields with "" escapes, CRLF/lone CR inside quotes read
as LF, quote junk, unterminated quotes re-read as unquoted, short/long row
padding and cutting with errors in order met).
How it is fast: a record holding no quote and no stray CR is taken whole
with one slice + split(','); other records are read field by field,
jumping between delimiters with one regex scan per field instead of walking
character by character. On the practice set it parses in ~0.16 s where
csv-reader 1.0.0 takes ~0.46 s on the same machine.
solve.js— the parser:export function run(input).main.ts— the driver the harness runs: reads every case from/input/cases.json, answers each withrun, writes/output/answers.json.
MIT — see LICENSE.