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
and I want to make sure that they start with @ both in runtime and in dev time; it would be helpful to be able to do something like
conststrings: MatchinString</^@(?!\s)*/>[] = ["@string", "@string with space", "string_without_@"]
// and then I would get a linting error on "@string with space" and "string_without_@"
Another use case here would be checking in runtime explicity
functionassertMatchingString<Textendsstring>(maybeMatching: T): asserts T is MatchingString</^@(?!\s)*/> {
if(!/^@(?!\s)*/.test(maybeMatching))throw"error";}
This would be especially useful in a setting where I want to perform code knowing that the strings are in the right format
// assume an inputStringassertMatchingString(inputString);// now inputString would of the type of regexsomeFunction(inputString)// this function would have a similar string definition in its input so that type comparisons can be made
The text was updated successfully, but these errors were encountered:
For example let's say I'm given a list of strings
and I want to make sure that they start with @ both in runtime and in dev time; it would be helpful to be able to do something like
Another use case here would be checking in runtime explicity
This would be especially useful in a setting where I want to perform code knowing that the strings are in the right format
The text was updated successfully, but these errors were encountered: