Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit ffa19a0

Browse files
committed
Clean up
1 parent 0ecdfb0 commit ffa19a0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

cli.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,15 @@ async function main() {
6161
}
6262

6363
const command = String(args.shift()) as keyof typeof commands
64+
const { default: cmd, helpMessage: cmdHelpMessage } = await import(`./commands/${command}.ts`)
6465

6566
// prints command help message
6667
if (options.h || options.help) {
67-
import(`./commands/${command}.ts`).then(({ helpMessage }) => {
68-
console.log(commands[command])
69-
console.log(helpMessage)
70-
Deno.exit(0)
71-
})
72-
return
68+
console.log(commands[command])
69+
console.log(cmdHelpMessage)
70+
Deno.exit(0)
7371
}
7472

75-
// import command module
76-
const { default: cmd } = await import(`./commands/${command}.ts`)
77-
7873
// execute `init` command
7974
if (command === 'init') {
8075
await cmd(options?.template, args[0])

server/compress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Compression {
1010
accept(acceptEncoding: string, contentType: string, contentLength: number): 'br' | 'gzip' | null {
1111
const shouldCompress = this.enable && (
1212
contentType.startsWith('text/') ||
13-
/^application\/(javascript|json|xml|wasm)/i.test(contentType) ||
14-
/^image\/svg\+xml/i.test(contentType)
13+
contentType.startsWith('image/svg+xml') ||
14+
/^application\/(javascript|json|xml|wasm)/i.test(contentType)
1515
)
1616
if (shouldCompress && contentLength > 1024) {
1717
if (acceptEncoding.includes('br')) {

0 commit comments

Comments
 (0)