Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed return value #3

Open
pke opened this issue Apr 20, 2023 · 0 comments
Open

Typed return value #3

pke opened this issue Apr 20, 2023 · 0 comments

Comments

@pke
Copy link

pke commented Apr 20, 2023

Thanks for writing this app, since cheerio can't seem to release a new version since 6 months!

I wonder why you choose to return a Promise<unknown> instead of a promise with the structure of the template (types)?
I guess its not easy to derive the type from the piped values, but how about adding a template argument to the function where we can specifiy the resulting objects shape?

Or have you looked at [zod](https://www.npmjs.com/package/zod) which is completely typesafe and also supports the concept of pipes (althought differently named).

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

No branches or pull requests

1 participant