-
-
Notifications
You must be signed in to change notification settings - Fork 231
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 new type: ValuesType #75
Comments
I think |
@levenleven agreed! I corrected the proposal, thanks! |
Another suggestion regarding constraints. I find them a bit restrictive
|
@levenleven As far as I tested any[] works with readonly arrays |
@IssueHunt has funded $25.00 to this issue.
|
Here's an example where it doesn't work with readonly arrays: const arr = [1, 2] as const; See result of |
Thanks for the example now I understand 👍 So the problem here is it's a tuple, not a read-only array, which needs a special case treatment a Yeah, I agree we should go with ArrayLike condition. |
Proposed in piotrwitek#75.
feat(utility-types): Add `ValuesType`. Proposed in piotrwitek#75.
@piotrwitek has rewarded $17.50 to @Axure. See it on IssueHunt
|
I could be misunderstanding this utility type, but it doesn't look like it works for interfaces: interface Foo {
bar: string;
baz: number;
}
type FooValue = ValuesType<Foo>;
// expected: string | number
// received: any |
@drewlustro actually I have tested and it works. |
Proposal to add ValuesType, looking for feedback:
IssueHunt Summary
axure has been rewarded.
Backers (Total: $25.00)
Submitted pull Requests
ValuesType
Tips
IssueHunt has been backed by the following sponsors. Become a sponsor
The text was updated successfully, but these errors were encountered: