Skip to content

Commit c8279e8

Browse files
committed
fix: use regex instead of replaceAll
1 parent 7d47a36 commit c8279e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app-config-schema/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ export async function loadSchema({
176176

177177
code = code.replace(
178178
/require\("ajv\/(.+)"\)/g,
179-
(_, match) => `require("${join(resolvedAjvPath, match).replaceAll('\\', '\\\\\\\\')}")`,
179+
(_, match) => `require("${join(resolvedAjvPath, match).replace(/\\/g, '\\\\\\\\')}")`,
180180
);
181181

182182
code = code.replace(
183183
/require\("ajv-formats\/(.+)"\)/g,
184-
(_, match) => `require("${join(resolvedAjvFormatsPath, match).replaceAll('\\', '\\\\\\\\')}")`,
184+
(_, match) => `require("${join(resolvedAjvFormatsPath, match).replace(/\\/g, '\\\\\\\\')}")`,
185185
);
186186

187187
return code;

0 commit comments

Comments
 (0)