Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
How to check if a string is included in a certain type - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
1 reply
j0hannes
How to check if a string is included in a certain type
Say you have
type Category
=
"twitter
"
|
"youtube
"
|
"spotify
"
then you need to check if a string is of type Category
what would the condition look like
?
Theo's Typesafe Cult
Join
26,564
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to check if type is array?
TTC
Theo's Typesafe Cult / questions
4y ago
zod to check if string is only whitespaces
TTC
Theo's Typesafe Cult / questions
4y ago
Best way to force Vercel build to fail If certain code is included?
TTC
Theo's Typesafe Cult / questions
4y ago
Type 'string | null' is not assignable to type 'string | undefined'.
TTC
Theo's Typesafe Cult / questions
3y ago