fix: race condition?
This commit is contained in:
parent
ee7619b93d
commit
a7b46d632a
@ -10,9 +10,9 @@ class ParserWithColumns extends Parser {
|
|||||||
/** @type {(s: import('csv-parse').Options) => () => ParserWithColumns} */
|
/** @type {(s: import('csv-parse').Options) => () => ParserWithColumns} */
|
||||||
export const makeImpl = c => () => {
|
export const makeImpl = c => () => {
|
||||||
const parser = new ParserWithColumns(c)
|
const parser = new ParserWithColumns(c)
|
||||||
while (parser.columns.length === 0) {
|
parser.once('data', chunk => {
|
||||||
parser.columns = parser.read() || [];
|
parser.columns = chunk;
|
||||||
}
|
})
|
||||||
return parser
|
return parser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user