Skip to content

Commit

Permalink
fix(csv-stringify): update quoted_match config option to accept arrays (
Browse files Browse the repository at this point in the history
#371)

* fix(csv-stringify): update quoted_match confug option to accept arrays

* test(csv-stringify): quoted_match array types tests

* chore(csv-stringify): dist generation

Co-authored-by: nezu <29180158+dumbasPL@users.noreply.github.com>
  • Loading branch information
mariuszste and dumbasPL authored Nov 30, 2022
1 parent 6489511 commit 42c468b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/csv-stringify/dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface Options extends stream.TransformOptions {
/**
* String or RegExp, no default, quote all fields matching a regular expression.
*/
quoted_match?: string | RegExp
quoted_match?: string | RegExp | (string | RegExp)[]
/**
* Boolean, default to false, quote all fields of type string even if not required.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/csv-stringify/dist/esm/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface Options extends stream.TransformOptions {
/**
* String or RegExp, no default, quote all fields matching a regular expression.
*/
quoted_match?: string | RegExp
quoted_match?: string | RegExp | (string | RegExp)[]
/**
* Boolean, default to false, quote all fields of type string even if not required.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/csv-stringify/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface Options extends stream.TransformOptions {
/**
* String or RegExp, no default, quote all fields matching a regular expression.
*/
quoted_match?: string | RegExp
quoted_match?: string | RegExp | (string | RegExp)[]
/**
* Boolean, default to false, quote all fields of type string even if not required.
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/csv-stringify/test/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ describe('API Types', () => {
const options: Options = {}
options.quoted_match = "\""
options.quoted_match = /\"/
options.quoted_match = [
"\"",
/\"/
]
})

it('quoted_string', () => {
Expand Down

0 comments on commit 42c468b

Please sign in to comment.