mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
chore: prettier
This commit is contained in:
parent
3138baf2c8
commit
4d7fa7abb6
6 changed files with 18 additions and 15 deletions
|
@ -18,7 +18,10 @@
|
|||
"lint": "eslint ./src/ --ext .ts",
|
||||
"lint:fix": "eslint ./src/ --ext .ts --fix"
|
||||
},
|
||||
"files": ["dist", "lib"],
|
||||
"files": [
|
||||
"dist",
|
||||
"lib"
|
||||
],
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
|
|
@ -108,7 +108,7 @@ export class ScramjetClient {
|
|||
resolve(data.port);
|
||||
}
|
||||
});
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ export class ScramjetClient {
|
|||
h.construct = function (
|
||||
constructor: any,
|
||||
argArray: any[],
|
||||
newTarget: AnyFunction,
|
||||
newTarget: AnyFunction
|
||||
) {
|
||||
let returnValue: any = undefined;
|
||||
let earlyreturn = false;
|
||||
|
@ -354,7 +354,7 @@ export class ScramjetClient {
|
|||
RawTrap<T>(
|
||||
target: any,
|
||||
prop: string,
|
||||
descriptor: Trap<T>,
|
||||
descriptor: Trap<T>
|
||||
): PropertyDescriptor {
|
||||
if (!target) return;
|
||||
if (!prop) return;
|
||||
|
|
|
@ -52,7 +52,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
for (const element of attrObject[attr]) {
|
||||
const descriptor = nativeGetOwnPropertyDescriptor(
|
||||
element.prototype,
|
||||
attr,
|
||||
attr
|
||||
);
|
||||
Object.defineProperty(element.prototype, attr, {
|
||||
get() {
|
||||
|
@ -80,7 +80,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
base: new URL(client.url.origin),
|
||||
origin: new URL(client.url.origin),
|
||||
} as URLMeta,
|
||||
true,
|
||||
true
|
||||
);
|
||||
} else if (["srcset", "imagesrcset"].includes(attr)) {
|
||||
value = rewriteSrcset(value, client.meta);
|
||||
|
@ -216,8 +216,8 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
return atob(
|
||||
client.natives["Element.prototype.getAttribute"].call(
|
||||
ctx.this,
|
||||
"data-scramjet-script-source-src",
|
||||
),
|
||||
"data-scramjet-script-source-src"
|
||||
)
|
||||
);
|
||||
}
|
||||
if (ctx.this instanceof self.HTMLStyleElement) {
|
||||
|
@ -307,7 +307,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
ctx.args[0],
|
||||
client.cookieStore,
|
||||
client.meta,
|
||||
false,
|
||||
false
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -319,7 +319,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
ctx.args[0],
|
||||
client.cookieStore,
|
||||
client.meta,
|
||||
true,
|
||||
true
|
||||
);
|
||||
},
|
||||
});
|
||||
|
@ -330,7 +330,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
ctx.args[0],
|
||||
client.cookieStore,
|
||||
client.meta,
|
||||
false,
|
||||
false
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ export function decodeUrl(url: string | URL) {
|
|||
|
||||
if (
|
||||
tryCanParseURL(url)?.pathname.startsWith(
|
||||
self.$scramjet.config.prefix + "worker",
|
||||
self.$scramjet.config.prefix + "worker"
|
||||
)
|
||||
) {
|
||||
return new URL(new URL(url).searchParams.get("origin")).href;
|
||||
|
@ -55,7 +55,7 @@ export function decodeUrl(url: string | URL) {
|
|||
return url;
|
||||
} else if (tryCanParseURL(url)) {
|
||||
return self.$scramjet.codec.decode(
|
||||
url.slice((location.origin + self.$scramjet.config.prefix).length),
|
||||
url.slice((location.origin + self.$scramjet.config.prefix).length)
|
||||
);
|
||||
} else {
|
||||
return url;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Scramjet</title>
|
||||
<link rel="icon" href="favicon.webp">
|
||||
<link rel="icon" href="favicon.webp" />
|
||||
<link rel="prefetch" href="/scram/scramjet.worker.js" />
|
||||
<link rel="prefetch" href="/scram/scramjet.shared.js" />
|
||||
<link
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue