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

IsLiteral should not require the type to be Primitive but check it internally #680

Closed
kkmuffme opened this issue Sep 7, 2023 · 1 comment · Fixed by #684
Closed

IsLiteral should not require the type to be Primitive but check it internally #680

kkmuffme opened this issue Sep 7, 2023 · 1 comment · Fixed by #684
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kkmuffme
Copy link
Contributor

kkmuffme commented Sep 7, 2023

Not sure why the IsLiteral type has a restriction, while other literal types don't have (neither do most other types)

export type IsLiteral<T extends Primitive> = IsNotFalse<IsLiteralUnion<T>>;

should be:

export type IsLiteral<T> = T extends Primitive ? IsNotFalse<IsLiteralUnion<T>> : false;

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@sindresorhus
Copy link
Owner

Agreed

@sindresorhus sindresorhus added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants