Skip to content

Commit

Permalink
fix: fixed node14 support (#51)
Browse files Browse the repository at this point in the history
* fix: fixed node14 support

This solution is ported directly from esbuild-plugin-version-injector

* fix: support node v14

* fix: remove side effect

Co-authored-by: parbez <imranbarbhuiya.fsd@gmail.com>
  • Loading branch information
favna and imranbarbhuiya authored Dec 18, 2022
1 parent a3b35f2 commit ced7aca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/utils/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable unicorn/prefer-string-replace-all -- node v14 doesn't supports string.replaceAll*/
export const escapeRegex = (str: string) => {
return str.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&').replaceAll('-', '\\x2d');
return str.replace(/[$()*+.?[\\\]^{|}]/g, '\\$&').replace(/-/g, '\\x2d');
};

export const removeEndingSlash = (str: string) => {
Expand Down

0 comments on commit ced7aca

Please sign in to comment.