fix(utils): Mutable variable must be non-const (#19)

This commit is contained in:
Lukas Senionis
2022-08-28 14:19:06 +03:00
committed by GitHub
parent 6842f31190
commit 1dd48cd4c4

View File

@@ -79,7 +79,7 @@ export function afterPatch(obj: any, name: string, fnc: (args: any[], ret: any)
export function replacePatch(obj: any, name: string, fnc: (args: any[]) => any, options: PatchOptions = {}): void {
const orig = obj[name];
obj[name] = function (...args: any[]) {
const ret = fnc.call(this, args);
let ret = fnc.call(this, args);
if (ret == 'CALL_ORIGINAL') ret = orig.call(this, ...args);
if (options.singleShot) {
unpatch(obj, name);