Reputation: 3039
Could somebody please help me with the following question:
Where can I find the list of ECMAScript features that have been implemented by Typescript? I'm particularly interested in RegExp Unicode property escapes which was added in ES2018 (which happened pretty recently according to this post). I would like to use this feature to add multi-language support for Angular, but couldn't find any evidence that it was adopted by Typescript.
P.s. I spent some time and found the following resources Issue on github, PR on github, Typescript Roadmap, ES compatibility Table.
From my understanding, they are very closely related to my question, but none of them can actually confirm that Unicode property escapes was implemented. I can still fallback to the transpiled solution, but it would be nice to use /\p{L}/u
instead of very long string.
Thank you in advance!
Upvotes: 4
Views: 2200
Reputation: 276181
Which ES2018 features are implemented in Typescript?
TypeScript only implements stage 3 and above features. Doubt many 2018 features are stage 3 yet. You can find the complete support list here
I'm particularly interested in RegExp Unicode property escapes which was added in ES2018
TypeScript parses this regex just fine :
const test = /^\p{White_Space}+$/u.test('\t \n\r');
However it doesn't down emit anything to support it for old JS runtimes. In short, it will not work if your runtime doesn't support it.
Upvotes: 6