open-draft / dotalias

A single configuration for path aliases to reuse across all your tools (TypeScript, Jest, webpack, Rollup, etc.).
91 stars 2 forks source link

Jest converter not escaping `-` #7

Closed moltar closed 2 years ago

moltar commented 2 years ago

When I use pathsToModuleNameMapper from ts-jest it produced the following:

sub-07510523649629819 => ^sub\\-07510523649629819$

When I use dotalias, it produces the following:

sub-07510523649629819 => ^sub-07510523649629819$

kettanaito commented 2 years ago

Interesting. Do you have a usage example that'd fail if the - is unescaped?

I'd like to understand better what is the reason behind escaping it.

moltar commented 2 years ago

Sorry, don't have any failing examples. I think it should be ok, since dash is special only inside character ranges, which are wrapped in [].

Please close if you feel like it's a non issue.

kettanaito commented 2 years ago

Thanks for following up on this. I will close the issue now until there's a reproduction scenario that confirms the dashes must be escaped. Thanks.