File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
} from 'node:tls' ;
13
13
import { EventEmitter } from 'node:events' ;
14
14
15
- import { Defaults , Environment } from './defaults.js' ;
15
+ import { Defaults } from './defaults.js' ;
16
16
import * as logger from './logging.js' ;
17
17
18
18
import { postgresqlErrorCodes } from './errors.js' ;
@@ -147,7 +147,7 @@ interface PreFlightQueue {
147
147
bind : Bind | null ;
148
148
}
149
149
150
- const DEFAULTS = new Defaults ( env as unknown as Environment ) ;
150
+ const DEFAULTS = new Defaults ( env as Record < string , string > ) ;
151
151
152
152
export type EventMap <
153
153
T = {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { userInfo } from 'node:os';
4
4
*
5
5
* See {@link https://www.postgresql.org/docs/current/libpq-envars.html} for a detailed description.
6
6
*/
7
- export interface Environment {
7
+ export type Environment = keyof {
8
8
PGCLIENTENCODING : string ;
9
9
PGCONNECT_TIMEOUT : string ;
10
10
PGDATABASE : string ;
@@ -23,7 +23,7 @@ function secToMsec(value?: number) {
23
23
24
24
export class Defaults {
25
25
constructor (
26
- env : Environment ,
26
+ env : Partial < Record < Environment , string > > ,
27
27
readonly host = env . PGHOST || 'localhost' ,
28
28
readonly port = parseInt ( env . PGPORT as string , 10 ) || 5432 ,
29
29
readonly user = env . PGUSER || userInfo ( ) . username ,
You can’t perform that action at this time.
0 commit comments