this repo has no description

core/patch: Don't patch module if it's been replaced

Changed files
+3 -1
packages
core
src
+3 -1
packages/core/src/patch.ts
···
const patchedStr = [];
const mappedName = moonlight.moonmap.modules[id];
let modified = false;
+
let swappedModule = false;
const exts = new Set<string>();
···
entry[id] = newModule;
entry[id].__moonlight = true;
replaced = newModule.toString().replace(/\n/g, "");
+
swappedModule = true;
}
}
···
}
if (modified) {
-
patchModule(id, patchedStr.join(", "), moduleString);
+
if (!swappedModule) patchModule(id, patchedStr.join(", "), moduleString);
moduleCache[id] = moduleString;
moonlight.patched.set(id, exts);
}