Use RegExp.source to represent regular expression in messages#12
Use RegExp.source to represent regular expression in messages#12davidjgoss merged 4 commits intomainfrom
Conversation
The forward slash is used to denote the start and end of the regex expression in TypeScript, but isn't part of the regex expression itself. Fixes: cucumber/compatibility-kit#153
|
This is a tricky one. Flags are allowed and the Just using the pattern rather than the whole literal in the message would have no impact functionally as we still use the original |
|
Yeah. That's fairly fundamental, each language has a different regex engine. We can't make that consistent. Can we omit the slashes if there are no flags? Or come up with a CCK specific solution? |
I think that's a good compromise. We could check the |
⚡️ What's your motivation?
The forward slash is used to denote the start and end of the regex expression in TypeScript, but isn't part of the regular expression itself.
Fixes: cucumber/compatibility-kit#153
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Reading MDN RegExp I see that the string representation also includes flags such as case in sensitve and global. e.g:
/pattern/ig. So we are losing some information here.Are flags allowed when using Cucumber JS? If so, what would that impact?
📋 Checklist: