Skip to content

Commit 12be318

Browse files
committed
fix code from trash
1 parent 85c20ac commit 12be318

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/pg-connection-string/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ConnectionOptions {
88
database: string | null | undefined
99
client_encoding?: string
1010
ssl?: boolean | string
11-
multihost?: string | null
11+
multihost?: string[] | null
1212

1313
application_name?: string
1414
fallback_application_name?: string

packages/pg-connection-string/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
//MIT License
55

66
const { URL } = require('url')
7-
//parses a connection string
7+
//
8+
/**
9+
* parses a connection string
10+
* @param str - a connection string to Postgres
11+
*/
812
function parse(str) {
913
//unix socket
1014
if (str.charAt(0) === '/') {
1115
const config = str.split(' ')
1216
return { host: config[0], database: config[1] }
1317
}
1418

15-
const multihost = str.includes(',')
16-
1719
// Check for empty host in URL
1820

1921
const config = {}

0 commit comments

Comments
 (0)