-
Notifications
You must be signed in to change notification settings - Fork 118
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
Typescript-aware helper functions #372
Comments
Hey @IlyaSemenov! Thank you for your suggestion! Let me think about it, they make sense to me but I need to check previous issues to kind of see the decisions that have been made in the past to align my thoughts with them and understand if it fits or not What can help you right now:
I think it's possible to add it to ts-essentials as runtime Utility functions but let me have a closer look and I will come back to you Feel free to 🏓 ping ⏰ me if it takes longer for me to respond, apologies for that in advance |
What
Disclaimer: I am sorry for misusing this form. if this repo had discussions enabled, I sure wouldn't open this as an issue.
I was wondering if
ts-essentials
is a reasonable place for more one-line generic runtime helpers alongsideassert
which repeat built-in node functions with better type safety?Examples
To be concrete, I have two cases in mind:
1. filter(Boolean)
This can be handled with one-line helper:
I know that e.g.
ramda
exportsisNotNil
which arguably makes more sense, but the proposedisBoolean
will supposedly tree-shake into nothing so it kinda fits as a typings-only helper.2. Array.includes
This can be handled with one-line helper:
This will not tree-shake into nothing, but neither
lodash
norramda
publishes this with two generic params. I agree that it probably makes more sense to pursue better typings there, but still I wanted to ask if you see ts-essentials a place for stuff like that, and where's the boundary if not.Additional Info
No response
The text was updated successfully, but these errors were encountered: