File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -56,23 +56,19 @@ class ErrsolePostgres extends EventEmitter {
56
56
constructor ( options = { } ) {
57
57
super ( ) ;
58
58
59
- const { tablePrefix = '' , ...pgOptions } = options ;
59
+ let { tablePrefix, ...pgOptions } = options ;
60
+ tablePrefix = tablePrefix ? `errsole_${ tablePrefix . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) } ` : 'errsole' ;
60
61
61
- this . tablePrefix = tablePrefix
62
- ? `errsole_${ tablePrefix . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 ] / g, '' ) } `
63
- : 'errsole' ;
64
-
65
- this . logsTable = `${ this . tablePrefix } _logs_v2` ;
66
- this . usersTable = `${ this . tablePrefix } _users` ;
67
- this . configTable = `${ this . tablePrefix } _config` ;
68
- this . notificationsTable = `${ this . tablePrefix } _notifications` ;
62
+ this . isConnectionInProgress = true ;
63
+ this . pool = new Pool ( pgOptions ) ;
64
+ this . logsTable = `${ tablePrefix } _logs_v2` ;
65
+ this . usersTable = `${ tablePrefix } _users` ;
66
+ this . configTable = `${ tablePrefix } _config` ;
67
+ this . notificationsTable = `${ tablePrefix } _notifications` ;
69
68
70
69
this . name = require ( '../package.json' ) . name ;
71
70
this . version = require ( '../package.json' ) . version || '0.0.0' ;
72
71
73
- this . isConnectionInProgress = true ;
74
- this . pool = new Pool ( pgOptions ) ;
75
-
76
72
this . pendingLogs = [ ] ;
77
73
this . batchSize = 100 ;
78
74
this . flushInterval = 1000 ;
You can’t perform that action at this time.
0 commit comments