File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/logger-middleware/src/lib Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ function colorizeDuration(value: string, duration?: number): string {
4848 return `${ GREEN } ${ value } ${ RESET } `
4949}
5050
51- function colorizeContentLength ( value : string , length ?: number ) : string {
52- const ONE_MB = 1024 * 1024
53- const ONE_HUNDRED_KB = 100 * 1024
54- const ONE_KB = 1024
51+ const ONE_MB = 1024 * 1024
52+ const ONE_HUNDRED_KB = 100 * 1024
53+ const ONE_KB = 1024
5554
55+ function colorizeContentLength ( value : string , length ?: number ) : string {
5656 if ( length === undefined ) return value
5757 if ( length >= ONE_MB ) return `${ RED } ${ value } ${ RESET } `
5858 if ( length >= ONE_HUNDRED_KB ) return `${ YELLOW } ${ value } ${ RESET } `
@@ -67,11 +67,13 @@ function colorizeMethod(value: string): string {
6767 case 'POST' :
6868 return `${ CYAN } ${ value } ${ RESET } `
6969 case 'PUT' :
70- return `${ YELLOW } ${ value } ${ RESET } `
7170 case 'PATCH' :
72- return `${ MAGENTA } ${ value } ${ RESET } `
71+ return `${ YELLOW } ${ value } ${ RESET } `
7372 case 'DELETE' :
7473 return `${ RED } ${ value } ${ RESET } `
74+ case 'HEAD' :
75+ case 'OPTIONS' :
76+ return `${ MAGENTA } ${ value } ${ RESET } `
7577 default :
7678 return value
7779 }
You can’t perform that action at this time.
0 commit comments