Skip to content

Commit

Permalink
refactor(csv): add ColumnSpecs alias
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Aug 28, 2023
1 parent 55e03ba commit 217cb84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/csv/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface ColumnSpec {
tx?: CellTransform;
}

export type ColumnSpecs = Record<string, ColumnSpec>;

export interface CommonCSVOpts {
/**
* Field delimiter character.
Expand Down Expand Up @@ -103,7 +105,7 @@ export interface CSVOpts extends CommonCSVOpts {
* If given as object, each key must match an existing/original column name
* (either as per 1st data row or the `header` option).
*/
cols: Nullable<ColumnSpec>[] | Record<string, ColumnSpec>;
cols: Nullable<ColumnSpec>[] | ColumnSpecs;
}

export interface CSVFormatOpts {
Expand Down

0 comments on commit 217cb84

Please sign in to comment.