Skip to content

Commit

Permalink
feat(csv-parse): ts type encoding with BufferEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 6, 2021
1 parent ef84fb2 commit 39a4388
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/csv-parse/dist/cjs/index.d.ts
Expand Up @@ -38,6 +38,11 @@ export type CastingDateFunction = (value: string, context: CastingContext) => Da

export type ColumnOption = string | undefined | null | false | { name: string };

/*
Note, could not `extends stream.TransformOptions` because encoding can be
BufferEncoding and undefined as well as null which is not defined in the
extended type.
*/
export interface Options {
/**
* If true, the parser will attempt to convert read data types to native types.
Expand Down Expand Up @@ -90,7 +95,7 @@ export interface Options {
/**
* Set the source and destination encoding, a value of `null` returns buffer instead of strings.
*/
encoding?: string | null;
encoding?: BufferEncoding | undefined;
/**
* Set the escape character, one character only, defaults to double quotes.
*/
Expand Down
7 changes: 6 additions & 1 deletion packages/csv-parse/dist/esm/index.d.ts
Expand Up @@ -38,6 +38,11 @@ export type CastingDateFunction = (value: string, context: CastingContext) => Da

export type ColumnOption = string | undefined | null | false | { name: string };

/*
Note, could not `extends stream.TransformOptions` because encoding can be
BufferEncoding and undefined as well as null which is not defined in the
extended type.
*/
export interface Options {
/**
* If true, the parser will attempt to convert read data types to native types.
Expand Down Expand Up @@ -90,7 +95,7 @@ export interface Options {
/**
* Set the source and destination encoding, a value of `null` returns buffer instead of strings.
*/
encoding?: string | null;
encoding?: BufferEncoding | undefined;
/**
* Set the escape character, one character only, defaults to double quotes.
*/
Expand Down
7 changes: 6 additions & 1 deletion packages/csv-parse/lib/index.d.ts
Expand Up @@ -38,6 +38,11 @@ export type CastingDateFunction = (value: string, context: CastingContext) => Da

export type ColumnOption = string | undefined | null | false | { name: string };

/*
Note, could not `extends stream.TransformOptions` because encoding can be
BufferEncoding and undefined as well as null which is not defined in the
extended type.
*/
export interface Options {
/**
* If true, the parser will attempt to convert read data types to native types.
Expand Down Expand Up @@ -90,7 +95,7 @@ export interface Options {
/**
* Set the source and destination encoding, a value of `null` returns buffer instead of strings.
*/
encoding?: string | null;
encoding?: BufferEncoding | undefined;
/**
* Set the escape character, one character only, defaults to double quotes.
*/
Expand Down

0 comments on commit 39a4388

Please sign in to comment.