Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

CsvError type missing from Typescript definition #295

Open
drl-max opened this issue Aug 4, 2020 · 3 comments
Open

CsvError type missing from Typescript definition #295

drl-max opened this issue Aug 4, 2020 · 3 comments

Comments

@drl-max
Copy link
Contributor

drl-max commented Aug 4, 2020

Describe the bug

There isn't a way to get the CsvError class definition when using Typescript.

To Reproduce

In version 4.11.1 take a look at the ~/lib/index.d.ts file and notice that there is no definition for CsvError to be exported.

Additional context

I took some time to look through the repo and couldn't see if those typings were being generated by Typescript or if they were made by hand. Happy to help if I can.

@wdavidw
Copy link
Member

wdavidw commented Aug 4, 2020

Yes, please help. I do not use Typescript, it is mostly based on contributions. I just request a test case to support new type definitions

@drl-max
Copy link
Contributor Author

drl-max commented Aug 5, 2020

Please let me know if the test cases are missing anything. I just wanted to verify that the Typescript definition still accurately expresses the functionality and that this type is what's thrown when an error happens.

@Gutza
Copy link

Gutza commented Jan 8, 2021

This also fails transpilation:

(async () => {
    const parser = fs.createReadStream(`foo.csv`).pipe(csvParse({}));
    for await (const record of parser) {
        console.log("Processing record");
    }
})

with the following error:

error TS2504: Type 'Parser' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants