File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
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 @@ -81,6 +81,16 @@ describe('API Types', () => {
81
81
options . columns = [ "b" , "a" ] ;
82
82
options . columns = [ "b" , "a" ] as const ;
83
83
} ) ;
84
+
85
+ it ( "colummns as mixed strings and objects" , ( ) => {
86
+ const options : Options = { } ;
87
+ options . columns = [
88
+ { key : "b" , header : "B" } ,
89
+ { key : "a" , header : "A" } ,
90
+ "c" ,
91
+ { key : "d" } ,
92
+ ] ;
93
+ } )
84
94
85
95
it ( 'delimiter' , ( ) => {
86
96
const options : Options = { }
You can’t perform that action at this time.
0 commit comments