fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
5.93k stars 181 forks source link

Returned Type of startsWith is still string #824

Open CordlessWool opened 1 week ago

CordlessWool commented 1 week ago

I am using TypeIds and want to validate if the given string is validateing the typeId. This is at least not a problem write now. But I use the typeId also in types, so my id type is x-${string} for example. The InferOutput is a string for this type.

If I use transform I can set the type correctly, but then I have a transform for just converting the typescript type, seem to be unnecassery? I also did not find a genreic param to define the return type.

fabian-hiller commented 1 week ago

Can you share a playground link with an example? Maybe custom is what you are looking for.