We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 412c014 commit d13a3b9Copy full SHA for d13a3b9
src/util/util.ts
@@ -17,12 +17,11 @@
17
18
import { mustGetDefaultFileSystem } from '../persist';
19
20
+const escapeAssertionReg = new RegExp(/(^|[^A-Za-z0-9_])([rp])[0-9]*\./g);
21
+
22
function escapeAssertion(s: string): string {
- s = s.replace(/(?<!\w)r[0-9]*\./g, (match) => {
- return match.replace('.', '_');
23
- });
24
- s = s.replace(/(?<!\w)p[0-9]*\./g, (match) => {
25
+ s = s.replace(escapeAssertionReg, (match, p1, p2) => {
+ return p1 + p2 + match.substring(p1.length + p2.length).replace('.', '_');
26
});
27
return s;
28
}
0 commit comments