Skip to content

Type Alias: CsvParseColumns<T>

ts
type CsvParseColumns<T> = 
  | readonly keyof T & string[]
| Partial<Record<string, keyof T & string>>;

Defined in: types.ts:145

Column selection and renaming for parsing into a record type T.

  • An array of keys names each column by position and emits objects with those keys. With header: true the CSV header row is dropped in favor of these.
  • A map of CSV header label to key renames and selects columns (header labels not in the map are dropped). Requires header: true.

Type Parameters

Type Parameter
T

Released under the MIT License.