From c713d85429f576db8f0904448f2a72cdbbbcb3b9 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Sun, 11 Sep 2022 18:00:56 -0400 Subject: [PATCH] run prettier --- README.md | 1 + src/api/patcher.ts | 35 +++++++++++++++++------------------ src/api/plugin.ts | 2 +- src/api/utils/logger.ts | 2 +- src/index.ts | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 0cb632a..f6c6294 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Because it's - Will break at the slightest poke or prod (related to the first one) ### Who's your least favourite sin? + Probably Mammon, due to a mix of me not liking their sin in general (greed 👎), and them being an ABSOLUTE ASSHOLE in nearly every fancanon out there. # Screenshots diff --git a/src/api/patcher.ts b/src/api/patcher.ts index 29ceadd..911e035 100644 --- a/src/api/patcher.ts +++ b/src/api/patcher.ts @@ -27,7 +27,7 @@ function wackyPatch( thisArg: any, [ctx, args]: [ctx: any, args: []] ) => { - console.log(thisArg) + console.log(thisArg); if (before !== undefined) before.apply(ctx, [args]); const res = patches["instead"] !== undefined @@ -66,8 +66,13 @@ function after(parentObj: any, name: string, func: AfterFunc) { } //idea shamelessly ripped from vencord, but done slightly differently (ie allowing for targetting specific webpack functions) -function regexPatch(match: RegExp | string, replace: string, obj: any, prop: string) { - const oldFunc = obj[prop] +function regexPatch( + match: RegExp | string, + replace: string, + obj: any, + prop: string +) { + const oldFunc = obj[prop]; const injId = Symbol(); const handler = { apply: ( @@ -75,18 +80,18 @@ function regexPatch(match: RegExp | string, replace: string, obj: any, prop: str thisArg: any, [ctx, args]: [ctx: any, args: []] ) => { - let oldfunc = target - let str: string = oldFunc.toString() - str = str.replaceAll(match, replace) - console.log("(" + str + ")") - let newfunc = eval.apply(ctx, ["(" + str + ")"]) - console.log(ctx) - return newfunc.apply(ctx, args) + let oldfunc = target; + let str: string = oldFunc.toString(); + str = str.replaceAll(match, replace); + console.log("(" + str + ")"); + let newfunc = eval.apply(ctx, ["(" + str + ")"]); + console.log(ctx); + return newfunc.apply(ctx, args); } }; const prox = new Proxy(obj[prop], handler); const orig = obj[prop]; - obj[prop] = prox + obj[prop] = prox; const unpatch = () => { obj[prop] = orig; }; @@ -98,13 +103,7 @@ function regexPatch(match: RegExp | string, replace: string, obj: any, prop: str return unpatch; } - -export { - instead, - before, - after, - regexPatch -}; +export { instead, before, after, regexPatch }; export default { instead, diff --git a/src/api/plugin.ts b/src/api/plugin.ts index f7c6436..19c796e 100644 --- a/src/api/plugin.ts +++ b/src/api/plugin.ts @@ -59,7 +59,7 @@ function add(iife: string, customMeta: UnknownObject = {}) { enabled: false, desc: exports.meta.desc }; - Object.assign(pluginNest.store.plugins[exports.meta.name], customMeta) + Object.assign(pluginNest.store.plugins[exports.meta.name], customMeta); } function del(name: string) { diff --git a/src/api/utils/logger.ts b/src/api/utils/logger.ts index 22d6d70..8307131 100644 --- a/src/api/utils/logger.ts +++ b/src/api/utils/logger.ts @@ -49,7 +49,7 @@ const warn = makeLogger(console.warn); const error = makeLogger(console.error); const trace = makeLogger(console.trace); const debug = makeLogger((...args) => { -/*#if _DEBUG + /*#if _DEBUG console.log(...args) //#endif */ }); diff --git a/src/index.ts b/src/index.ts index 63d4fc7..bd7e427 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,4 +55,4 @@ window.demon = { }; plugins.init(); -settings.init(); \ No newline at end of file +settings.init();