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 ec1725b commit 3d1df2aCopy full SHA for 3d1df2a
src/__tests__/util.test.ts
@@ -33,6 +33,7 @@ it('extracts dirname', () => {
33
expect(Util.dirname('abc$$def$', '$')).toBe('abc');
34
35
expect(Util.dirname('abc::def:', '::')).toBe('abc');
36
+ expect(Util.dirname('abc$`$`def$`$`hij$`klm', '$`')).toBe('abc$`def$`hij');
37
});
38
39
it('extracts extname', () => {
src/util.ts
@@ -10,7 +10,7 @@ function regexEscape(literal: string) {
10
*/
11
function normalizeSeparator(path: string, separator: string) {
12
const sepRe = new RegExp(`(${regexEscape(separator)}){2,}`, 'g');
13
- return path.replace(sepRe, separator.replaceAll('$', '$$$$'));
+ return path.replace(sepRe, separator.replace(/\$/g, '$$$$'));
14
}
15
16
/**
0 commit comments