| 274 | extended type. |
| 275 | */ |
| 276 | export interface Options<T = string[], U = T> { |
| 277 | /** |
| 278 | * If true, the parser will attempt to convert read data types to native types. |
| 279 | * @deprecated Use {@link cast} |
| 280 | */ |
| 281 | auto_parse?: boolean | CastingFunction; |
| 282 | autoParse?: boolean | CastingFunction; |
| 283 | /** |
| 284 | * If true, the parser will attempt to convert read data types to dates. It requires the "auto_parse" option. |
| 285 | * @deprecated Use {@link cast_date} |
| 286 | */ |
| 287 | auto_parse_date?: boolean | CastingDateFunction; |
| 288 | autoParseDate?: boolean | CastingDateFunction; |
| 289 | /** |
| 290 | * If true, detect and exclude the byte order mark (BOM) from the CSV input if present. |
| 291 | */ |
| 292 | bom?: OptionsNormalized["bom"]; |
| 293 | /** |
| 294 | * If true, the parser will attempt to convert input string to native types. |
| 295 | * If a function, receive the value as first argument, a context as second argument and return a new value. More information about the context properties is available below. |
| 296 | */ |
| 297 | cast?: OptionsNormalized["cast"]; |
| 298 | /** |
| 299 | * If true, the parser will attempt to convert input string to dates. |
| 300 | * If a function, receive the value as argument and return a new value. It requires the "auto_parse" option. Be careful, it relies on Date.parse. |
| 301 | */ |
| 302 | cast_date?: OptionsNormalized["cast_date"]; |
| 303 | castDate?: OptionsNormalized["cast_date"]; |
| 304 | /** |
| 305 | * List of fields as an array, |
| 306 | * a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, |
| 307 | * default to null, |
| 308 | * affect the result data set in the sense that records will be objects instead of arrays. |
| 309 | */ |
| 310 | columns?: |
| 311 | | OptionsNormalized["columns"] |
| 312 | | (( |
| 313 | record: T, |
| 314 | ) => ColumnOption< |
| 315 | T extends string[] ? string : T extends unknown ? string : keyof T |
| 316 | >[]); |
| 317 | /** |
| 318 | * Treat all the characters after this one as a comment, default to '' (disabled). |
| 319 | */ |
| 320 | comment?: OptionsNormalized["comment"] | boolean; |
| 321 | /** |
| 322 | * Restrict the definition of comments to a full line. Comment characters |
| 323 | * defined in the middle of the line are not interpreted as such. The |
| 324 | * option require the activation of comments. |
| 325 | */ |
| 326 | comment_no_infix?: OptionsNormalized["comment_no_infix"] | null; |
| 327 | /** |
| 328 | * Set the field delimiter. One character only, defaults to comma. |
| 329 | */ |
| 330 | delimiter?: OptionsNormalized["delimiter"] | string | string[] | Buffer; |
| 331 | /** |
| 332 | * Discover the field delimiter |
| 333 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected