Skip to content

Commit 44f2e7c

Browse files
authored
feat(csv-parse): set columns type as readonly (#358)
The goal is for stringify to support values declared `as const`. eg. ``` const columns = ['name', 'age'] as const stringify({columns}) ``` As this array has no reasons to be mutated by `stringify` it's simpler to set it as `readonly`.
1 parent 410e7b1 commit 44f2e7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/csv-stringify/lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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?: string[] | PlainObject<string> | ColumnOption[]
64+
columns?: readonly string[] | PlainObject<string> | readonly ColumnOption[]
6565
/**
6666
* Set the field delimiter, one character only, defaults to a comma.
6767
*/

0 commit comments

Comments
 (0)