Deleted user
Deleted user
Personally, I don't feel that the non-closure/block use cases of this are really strong enough to warrant adding this, and the closure/block use case can be fixed with `clone` blocks....
What about validation of [JSON schema's `patternProperties` regex](https://json-schema.org/understanding-json-schema/reference/object.html#pattern-properties) in TypeScript interfaces for the parsed object? This is a PERFECT application of the regex-validated string feature. Possible syntax using a `matchof`...
(CC @Igmat) It occurs to me that there's a leaning towards using regex tests as type literals in #6579, i.e. ```typescript type CssColor = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/i; const color: CssColor = '#000000';...
Good to know about `RegExp.prototype.test`. The ambiguity seems straightforward to me. As we know, TypeScript is a JS superset & [regex values can be used as variables](https://github.com/microsoft/vscode/blob/v14/src/vs/workbench/contrib/debug/browser/linkDetector.ts#L20-L25). To me, a...
My concern is that the regex means two different things in the two contexts - literal vs "returns true from RegExp.test method". The latter seems like a type system feature...
There is also the issue of regex literals and regex types possibly being used as superclasses: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@split If all regex literals and type variables are cast into...
So one could implement an entire custom JSON schema validator in TypeScript? Interesting..
To me, i18n is a big reason to avoid custom error messages, at least until TypeScript adds some native consistent way to internationalise those for users of other languages.
Don't get me wrong, I actually like the syntax and I feel that it's more TypeScript-ish than the current proposal, which still confuses me to some degree.
> You may want to use > > ``` > > title = md("**gtcars**"), > ``` Thanks. Have you read the > Yes, I know I can use md("**my title**"),...