Skip to content

Commit 5df7c2b

Browse files
squash!
1 parent 1712a11 commit 5df7c2b

File tree

10 files changed

+57
-52
lines changed

10 files changed

+57
-52
lines changed

Configuration/ESBuild.js

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
export default {
2-
color: true,
3-
format: "esm",
4-
metafile: true,
5-
minify: false,
6-
outdir: "Target",
7-
platform: "node",
8-
target: "esnext",
9-
write: true,
10-
logLevel: "debug",
11-
plugins: [
12-
{
13-
name: "Target",
14-
setup({ onStart, initialOptions: { outdir } }) {
15-
onStart(async () => {
16-
try {
17-
outdir
18-
? await (await import("fs/promises")).rm(outdir, {
19-
recursive: true,
20-
})
21-
: {};
22-
}
23-
catch (_Error) {
24-
console.log(_Error);
25-
}
26-
});
27-
},
28-
},
29-
],
30-
define: {
31-
"process.env.VERSION_PACKAGE": `'${(await (await import("typescript-esbuild/Target/Function/JSON.js")).default("package.json"))?.version}'`,
32-
},
2+
color: true,
3+
format: "esm",
4+
metafile: true,
5+
minify: false,
6+
outdir: "Target",
7+
platform: "node",
8+
target: "esnext",
9+
write: true,
10+
logLevel: "debug",
11+
plugins: [
12+
{
13+
name: "Target",
14+
setup({ onStart, initialOptions: { outdir } }) {
15+
onStart(async () => {
16+
try {
17+
outdir
18+
? await (
19+
await import("fs/promises")
20+
).rm(outdir, {
21+
recursive: true,
22+
})
23+
: {};
24+
} catch (_Error) {
25+
console.log(_Error);
26+
}
27+
});
28+
},
29+
},
30+
],
31+
define: {
32+
"process.env.VERSION_PACKAGE": `'${(await (await import("typescript-esbuild/Target/Function/JSON.js")).default("package.json"))?.version}'`,
33+
},
3334
};

Configuration/ESBuild.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export default {
1515
onStart(async () => {
1616
try {
1717
outdir
18-
? await (await import("fs/promises")).rm(outdir, {
18+
? await (
19+
await import("fs/promises")
20+
).rm(outdir, {
1921
recursive: true,
20-
})
22+
})
2123
: {};
2224
} catch (_Error) {
2325
console.log(_Error);

Source/Function/Access.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export default (async (
1212

1313
return JSON.parse(
1414
(await import("buffer")).Buffer.from(
15-
await (await import("./Decrypt.js")).default(
15+
await (
16+
await import("./Decrypt.js")
17+
).default(
1618
await Uint8ArrayFromObject(Data),
1719
Key ?? "",
18-
await Uint8ArrayFromObject(Vector),
19-
),
20-
).toString(),
20+
await Uint8ArrayFromObject(Vector)
21+
)
22+
).toString()
2123
)[View];
2224
} catch (_Error) {
2325
console.log(_Error);

Source/Function/Decrypt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export default (async (...[Data, Key, Vector]: Parameters<Type>) =>
2727
name: "AES-GCM",
2828
},
2929
false,
30-
["encrypt", "decrypt"],
30+
["encrypt", "decrypt"]
3131
),
32-
Data,
33-
),
32+
Data
33+
)
3434
)) satisfies Type as Type;
3535

3636
import type Type from "../Interface/Decrypt.js";

Source/Function/Encrypt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export default (async (...[Data, Key]: Parameters<Type>) => {
3232
name: "AES-GCM",
3333
},
3434
false,
35-
["encrypt", "decrypt"],
35+
["encrypt", "decrypt"]
3636
),
3737
(await import("buffer")).Buffer.from(JSON.stringify(Data))
38-
.buffer,
39-
),
38+
.buffer
39+
)
4040
),
4141
};
4242
}) satisfies Type as Type;

Source/Function/Get.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export default (async (...[Instance]: Parameters<Type>) => {
1818
) {
1919
_Map.set(
2020
Key,
21-
await (await import("@Function/Get.js")).default(
22-
Instance[Key],
23-
),
21+
await (
22+
await import("@Function/Get.js")
23+
).default(Instance[Key])
2424
);
2525
} else {
2626
_Map.set(Key, Instance[Key]);

Source/Function/Put.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export default (async (...[Instance]: Parameters<Type>) => {
1111

1212
for (const [Key, Value] of Instance.entries()) {
1313
if (Value instanceof Map) {
14-
_Value[Key] = await (await import("@Function/Put.js")).default(
15-
Value,
16-
);
14+
_Value[Key] = await (
15+
await import("@Function/Put.js")
16+
).default(Value);
1717
} else {
1818
_Value[Key] = Value;
1919
}

Source/Function/Redirect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export default (async (...Option: Parameters<Type>) =>
66
Response.redirect(
77
Option[0] ?? "",
8-
Option[1] ?? 302,
8+
Option[1] ?? 302
99
)) satisfies Type as Type;
1010

1111
import type Type from "../Interface/Redirect.js";

Source/Interface/Access.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default interface Type {
2828
Key: JsonWebKey["k"],
2929
Identifier: ReturnType<Crypto["randomUUID"]>,
3030
KV: KVNamespace,
31-
View: string,
31+
View: string
3232
): unknown;
3333
}
3434

Source/Interface/Decrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default interface Type {
2525
(
2626
Data: Uint8Array,
2727
Key: JsonWebKey["k"],
28-
Vector: Uint8Array,
28+
Vector: Uint8Array
2929
): Promise<Uint8Array>;
3030
}
3131

0 commit comments

Comments
 (0)