File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 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 {
6161 * can refer to nested properties of the input JSON
6262 * see the "header" option on how to print columns names on the first line
6363 */
64- columns ?: readonly string [ ] | PlainObject < string > | readonly ColumnOption [ ]
64+ columns ?: ReadonlyArray < string | ColumnOption > | PlainObject < string >
6565 /**
6666 * Set the field delimiter, one character only, defaults to a comma.
6767 */
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('API Types', () => {
2020 const rd : RecordDelimiter | undefined = options . record_delimiter
2121 const cast = options . cast
2222 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
2424 return [
2525 rd , castBoolean , columns
2626 ]
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ describe('API Types', () => {
7070 { key : 'b' } ,
7171 { key : 'a' }
7272 ]
73+ options . columns = [
74+ { key : "b" , header : "B" } ,
75+ { key : "a" , header : "A" } ,
76+ "c" ,
77+ { key : "d" } ,
78+ ] ;
7379 options . columns = {
7480 field1 : 'column1' ,
7581 field3 : 'column3'
@@ -81,7 +87,7 @@ describe('API Types', () => {
8187 options . columns = [ "b" , "a" ] ;
8288 options . columns = [ "b" , "a" ] as const ;
8389 } ) ;
84-
90+
8591 it ( 'delimiter' , ( ) => {
8692 const options : Options = { }
8793 options . delimiter = ':'
You can’t perform that action at this time.
0 commit comments