File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const where = (conditions, firstArgIndex = 1) => {
23
23
}
24
24
if ( value . includes ( '*' ) || value . includes ( '?' ) ) {
25
25
operator = 'LIKE' ;
26
- value = value . replace ( / \* / g , '%' ) . replace ( / \? / g , '_' ) ;
26
+ value = value . replace ( '*' , '%' ) . replace ( '?' , '_' ) ;
27
27
}
28
28
}
29
29
clause . push ( `${ key } ${ operator } $${ i ++ } ` ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Logger {
18
18
const date = new Date ( ) . toISOString ( ) . substring ( 0 , 10 ) ;
19
19
const filePath = path . join ( logPath , `${ date } -W${ threadId } .log` ) ;
20
20
this . stream = fs . createWriteStream ( filePath , { flags : 'a' } ) ;
21
- this . regexp = new RegExp ( path . dirname ( this . path ) , 'g' ) ;
21
+ this . home = path . dirname ( this . path ) ;
22
22
}
23
23
24
24
close ( ) {
@@ -31,7 +31,7 @@ class Logger {
31
31
const color = COLORS [ level ] ;
32
32
const line = date + '\t' + s ;
33
33
console . log ( color + line + '\x1b[0m' ) ;
34
- const out = line . replace ( / [ \n \r ] \s * / g , '; ' ) + '\n' ;
34
+ const out = line . replaceAll ( '\n' , '; ' ) + '\n' ;
35
35
this . stream . write ( out ) ;
36
36
}
37
37
@@ -51,8 +51,8 @@ class Logger {
51
51
}
52
52
53
53
error ( ...args ) {
54
- const msg = util . format ( ...args ) . replace ( / [ \n \r ] { 2 , } / g , '\n' ) ;
55
- this . write ( 'error' , msg . replace ( this . regexp , '' ) ) ;
54
+ const msg = util . format ( ...args ) ;
55
+ this . write ( 'error' , msg . replaceAll ( this . home , '' ) ) ;
56
56
}
57
57
58
58
system ( ...args ) {
You can’t perform that action at this time.
0 commit comments