@@ -9,8 +9,8 @@ import { testEmptyLine } from './utils'
99
1010/**
1111 * Parses a chunk of bytes into CSV data.
12+ * @param bytes The chunk of bytes to parse.
1213 * @param options Options for parsing the chunk.
13- * @param options.bytes The chunk of bytes to parse.
1414 * @param options.delimiter The delimiter used in the CSV data. Defaults to ','.
1515 * @param options.newline The newline used in the CSV data. Defaults to '\n'.
1616 * @param options.quoteChar The quote character used in the CSV data. Defaults to '"'.
@@ -22,27 +22,26 @@ import { testEmptyLine } from './utils'
2222 * @yields Parsed data and metadata.
2323 * @returns A generator yielding parsed data and metadata.
2424 */
25- export function * parseChunk ( {
26- bytes,
27- delimiter,
28- newline,
29- quoteChar,
30- escapeChar,
31- comments,
32- delimitersToGuess,
33- skipEmptyLines,
34- ignoreLastRow,
35- } : {
36- bytes : Uint8Array
37- delimiter ?: string
38- newline ?: string
39- quoteChar ?: string
40- escapeChar ?: string
41- comments ?: boolean | string
42- delimitersToGuess ?: string [ ]
43- skipEmptyLines ?: boolean | 'greedy'
44- ignoreLastRow ?: boolean
45- } ) : Generator < ParseResult , void , unknown > {
25+ export function * parseChunk ( bytes : Uint8Array ,
26+ {
27+ delimiter,
28+ newline,
29+ quoteChar,
30+ escapeChar,
31+ comments,
32+ delimitersToGuess,
33+ skipEmptyLines,
34+ ignoreLastRow,
35+ } : {
36+ delimiter ?: string
37+ newline ?: string
38+ quoteChar ?: string
39+ escapeChar ?: string
40+ comments ?: boolean | string
41+ delimitersToGuess ?: string [ ]
42+ skipEmptyLines ?: boolean | 'greedy'
43+ ignoreLastRow ?: boolean
44+ } = { } ) : Generator < ParseResult , void , unknown > {
4645 const decoder = new TextDecoder ( 'utf-8' )
4746 const input = decoder . decode ( bytes )
4847
0 commit comments