-
-
Notifications
You must be signed in to change notification settings - Fork 660
Open
Labels
Description
I was looking for a way to implement “any string that doesn’t start with a slash” with template literals, then I realized that it can be achieved with a generic Not type:
type Unslashed = Not<string, `/${string}`>
const valid: Unslashed = 'home'
const invalid: Unslashed = '/home'Is there anything like Not?
Edit: related: