File tree 3 files changed +9
-3
lines changed 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export interface Options extends stream.TransformOptions {
61
61
* can refer to nested properties of the input JSON
62
62
* see the "header" option on how to print columns names on the first line
63
63
*/
64
- columns ?: readonly string [ ] | PlainObject < string > | readonly ColumnOption [ ]
64
+ columns ?: ReadonlyArray < string | ColumnOption > | PlainObject < string >
65
65
/**
66
66
* Set the field delimiter, one character only, defaults to a comma.
67
67
*/
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('API Types', () => {
20
20
const rd : RecordDelimiter | undefined = options . record_delimiter
21
21
const cast = options . cast
22
22
const castBoolean : Cast < boolean > | undefined = cast ?. boolean
23
- const columns : readonly string [ ] | PlainObject < string > | readonly ColumnOption [ ] | undefined = options . columns
23
+ const columns : ReadonlyArray < string | ColumnOption > | PlainObject < string > | undefined = options . columns
24
24
return [
25
25
rd , castBoolean , columns
26
26
]
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ describe('API Types', () => {
70
70
{ key : 'b' } ,
71
71
{ key : 'a' }
72
72
]
73
+ options . columns = [
74
+ { key : "b" , header : "B" } ,
75
+ { key : "a" , header : "A" } ,
76
+ "c" ,
77
+ { key : "d" } ,
78
+ ] ;
73
79
options . columns = {
74
80
field1 : 'column1' ,
75
81
field3 : 'column3'
@@ -81,7 +87,7 @@ describe('API Types', () => {
81
87
options . columns = [ "b" , "a" ] ;
82
88
options . columns = [ "b" , "a" ] as const ;
83
89
} ) ;
84
-
90
+
85
91
it ( 'delimiter' , ( ) => {
86
92
const options : Options = { }
87
93
options . delimiter = ':'
You can’t perform that action at this time.
0 commit comments