type HexString = /[a-z\d]+/;
const hexId: HexString = 'b9283d50ff2db1d95c08395e73556bc5c147e22125280e78c569603ac6854fe6';
I searched through the closed and open issues and didn't find any suggestions exactly like this, but maybe I didn't look hard enough, because it seems like a very obvious suggestion to me.
📃 Motivating Example
This will help me create any custom string type.
💻 Use Cases
What do you want to use this for?
After validate a string with a regex, by using the regex as type I will be suure that I no need validate that data again.
What shortcomings exist with current approaches?
I found nothing functional that can bring me something like this.
What workarounds are you using in the meantime?
I'm using string type and crying.
🔍 Search Terms
"regex type", "regular expression type"
✅ Viability Checklist
⭐ Suggestion
Hey people, how are you doing? I would like to suggest use regex as a custom type:
also
I searched through the closed and open issues and didn't find any suggestions exactly like this, but maybe I didn't look hard enough, because it seems like a very obvious suggestion to me.
📃 Motivating Example
This will help me create any custom string type.
💻 Use Cases
What do you want to use this for? After validate a string with a regex, by using the regex as type I will be suure that I no need validate that data again.
What shortcomings exist with current approaches? I found nothing functional that can bring me something like this.
What workarounds are you using in the meantime? I'm using string type and crying.