-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Add NonEmptyArray
to lib
(but **not** length > 0
narrowing)
#60491
Comments
NonEmptyArray
(but **not** length > 0
narrowing)NonEmptyArray
to lib
(but **not** length > 0
narrowing)
I'm confused by this; is the suggestion that a The new issue template for "library change" doesn't mention it, but the "new feature" template has a rule that
So I don't see how or why this would be added to TypeScript. @RyanCavanaugh, could you clarify why this is awaiting more feedback instead of just declined? Thanks! |
I've considered specifying
I'm unsure if this counts as a utility, as it's not a "type of types" but a more concrete (while still generic) "array of 1 or more things" |
It's a generic type whose instantiation is a concrete type, which is the case for all generic types in TypeScript (the language doesn't support higher-kinded types). |
Correct! I should've said something like:
I beg to differ: #55280 (see the |
Hmm, I really wish someone from the TS team would re-review this, otherwise this is apparently going to remain unresolved. Your suggested types are still utility types ( As for ES2023, the library change feature is supposed to be something like #59162: some particular JS feature that was introduced with ES2023 is either missing or incorrect in the TS library. You're not talking about any JS feature at all, in any version of JS. That's why you balked at the documentation link. Utility types tend to go in the ES5 library, since it would be quite strange for someone targeting ES2018 to not have I've made an attempt to explain what's going on, but I am not a member of the TS team, so I cannot speak authoritatively about this. At this point I'm in danger of merely repeating myself (maybe I already have?) so I'll disengage until and unless more definitive happens. |
⚙ Compilation target
ES2023
⚙ Library
ES2023
Missing / Incorrect Definition
Sample Code
Documentation Link
There's no docs that I'm aware of. However, there are multiple issues using this boilerplate.
Here's a WIP example implementations of
sum
. The sample code is a simplified version of that. More info hereThe text was updated successfully, but these errors were encountered: