Skip to content

Commit 1afbfa6

Browse files
Potential fix for code scanning alert no. 6: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent a67bf5d commit 1afbfa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jest-resolver.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = (request, options) => {
1919
if (mapping) {
2020
const base = typeof mapping === "string" ? mapping : mapping.source || mapping.default;
2121
if (base) {
22-
const prefix = base.replace("*", "");
22+
const prefix = base.replace(/\*$/, "");
2323
const suffix = request.slice(2);
2424
if (suffix.includes("..") || path.isAbsolute(suffix)) {
2525
throw new Error(`Unsafe import path: ${request}`);

0 commit comments

Comments
 (0)