run prettier

master
Drake 2 years ago
parent 1ca158e39f
commit c713d85429

@ -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

@ -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,

@ -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) {

@ -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 */
});

@ -55,4 +55,4 @@ window.demon = {
};
plugins.init();
settings.init();
settings.init();

Loading…
Cancel
Save