You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a usecase where we receive/produce string as a type, which should be typed as QueryDslTextQueryType. I would like to have a way in this library (as single source of truth) to produce a QueryDslTextQueryType from a string.
Motivation
It's much better if the guard is produced and maintained tightly with this library.
Example
enum QueryDslTextQueryType {
// the values of QueryDslTextQueryType union type
}
function isQueryDslTextQueryType(arg: any): arg is QueryDslTextQueryType {
return Object.values(QueryDslTextQueryType).includes(arg)
}
The text was updated successfully, but these errors were encountered:
Seems like this could be an opportunity to generate type guards for most or all types in the whole library. Going to think about this for a bit and see if it's reasonable to implement.
🚀 Feature Proposal
We have a usecase where we receive/produce
string
as a type, which should be typed asQueryDslTextQueryType
. I would like to have a way in this library (as single source of truth) to produce aQueryDslTextQueryType
from a string.Motivation
It's much better if the guard is produced and maintained tightly with this library.
Example
The text was updated successfully, but these errors were encountered: