This repository was archived by the owner on Jul 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -61,20 +61,15 @@ async function main() {
61
61
}
62
62
63
63
const command = String ( args . shift ( ) ) as keyof typeof commands
64
+ const { default : cmd , helpMessage : cmdHelpMessage } = await import ( `./commands/${ command } .ts` )
64
65
65
66
// prints command help message
66
67
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 )
73
71
}
74
72
75
- // import command module
76
- const { default : cmd } = await import ( `./commands/${ command } .ts` )
77
-
78
73
// execute `init` command
79
74
if ( command === 'init' ) {
80
75
await cmd ( options ?. template , args [ 0 ] )
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ class Compression {
10
10
accept ( acceptEncoding : string , contentType : string , contentLength : number ) : 'br' | 'gzip' | null {
11
11
const shouldCompress = this . enable && (
12
12
contentType . startsWith ( 'text/' ) ||
13
- / ^ a p p l i c a t i o n \/ ( j a v a s c r i p t | j s o n | x m l | w a s m ) / i . test ( contentType ) ||
14
- / ^ i m a g e \/ s v g \+ x m l / i. test ( contentType )
13
+ contentType . startsWith ( 'image/svg+xml' ) ||
14
+ / ^ a p p l i c a t i o n \/ ( j a v a s c r i p t | j s o n | x m l | w a s m ) / i. test ( contentType )
15
15
)
16
16
if ( shouldCompress && contentLength > 1024 ) {
17
17
if ( acceptEncoding . includes ( 'br' ) ) {
You can’t perform that action at this time.
0 commit comments