chore: prettier.... TWO!

This commit is contained in:
wearrrrr 2024-10-10 19:35:08 -05:00
parent 3436d85888
commit 0d4ee9ee96
5 changed files with 18 additions and 18 deletions

View file

@ -171,8 +171,8 @@ export default function (client: ScramjetClient, self: typeof window) {
// since the prototype chain is fucked
const style = ctx.get() as CSSStyleDeclaration;
return new Proxy(style, {
return new Proxy(style, {
get(t, p) {
const v = Reflect.get(t, p);
if (typeof v === "function") {
@ -190,8 +190,8 @@ return new Proxy(style, {
if (v == "" || typeof v !== "string") {
return Reflect.set(t, p, v);
}
return Reflect.set(t, p, rewriteCss(v, client.meta));
return Reflect.set(t, p, rewriteCss(v, client.meta));
},
});
},

View file

@ -10,8 +10,8 @@ export default function (client: ScramjetClient, self: Self) {
client.Trap("IDBDatabase.prototype.name", {
get(ctx) {
const name = ctx.get() as string;
return name.substring(name.indexOf("@") + 1);
return name.substring(name.indexOf("@") + 1);
},
});
}

View file

@ -85,15 +85,15 @@ export default function (client: ScramjetClient, self: Self) {
client.RawTrap(ctx.this, "response", {
get() {
if (ctx.this.responseType === "arraybuffer") return bodyab.buffer;
return body;
return body;
},
});
client.RawTrap(ctx.this, "responseXML", {
get() {
const parser = new DOMParser();
return parser.parseFromString(body, "text/xml");
return parser.parseFromString(body, "text/xml");
},
});
client.RawTrap(ctx.this, "getAllResponseHeaders", {
@ -106,8 +106,8 @@ return parser.parseFromString(body, "text/xml");
return (header: string) => {
const re = new RegExp(`^${header}: (.*)$`, "m");
const match = re.exec(headers);
return match ? match[1] : null;
return match ? match[1] : null;
};
},
});

View file

@ -66,8 +66,8 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
if (typeof v === "string" && v.includes("scramjet")) {
debugger;
}
return v;
return v;
};
// location = "..." can't be rewritten as wrapfn(location) = ..., so instead it will actually be rewritten as

View file

@ -272,14 +272,14 @@ export function rewriteSrcset(srcset: string, meta: URLMeta) {
function base64ToBytes(base64) {
const binString = atob(base64);
return Uint8Array.from(binString, (m) => m.codePointAt(0));
return Uint8Array.from(binString, (m) => m.codePointAt(0));
}
function bytesToBase64(bytes: Uint8Array) {
const binString = Array.from(bytes, (byte) =>
String.fromCodePoint(byte)
).join("");
return btoa(binString);
return btoa(binString);
}