From 2b73e3b41141b61eb5fbb650ce58807fc2336779 Mon Sep 17 00:00:00 2001 From: desu-bot Date: Wed, 18 Jun 2025 20:26:53 +0000 Subject: [PATCH] chore: update public repo --- utils/csv.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/csv.ts b/utils/csv.ts index 609848b..6075533 100644 --- a/utils/csv.ts +++ b/utils/csv.ts @@ -16,8 +16,8 @@ interface CsvReaderOptions { */ assumeEmptyValues: boolean - /** whether to treat header line as a data line */ - includeHeader: boolean + /** whether to treat all data from the readable as data (requires `schema` to be set) */ + skipHeader: boolean } export class CsvReader { @@ -29,7 +29,7 @@ export class CsvReader { options: Partial & { /** fields that are expected in the csv */ schema?: Fields - }, + } = {}, ) { this.options = { lineDelimiter: '\n', @@ -37,14 +37,14 @@ export class CsvReader { quote: '"', quoteEscape: '"', assumeEmptyValues: false, - includeHeader: false, + skipHeader: false, ...options, } this.#codec = new FramedReader(stream, new TextDelimiterCodec(this.options.lineDelimiter)) this.#schema = options.schema - if (options.includeHeader) { + if (options.skipHeader) { if (!options.schema) throw new Error('schema is required if includeHeader is true') this.#header = options.schema }