Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xxaier authored Aug 21, 2023
1 parent 53fbaa1 commit b88c3b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ function parseOptions(a, b) {
}

return {
host : Array.isArray(host) ? host : host.split(',').map(x => new URL(x).hostname.replace(/[\[\]]/g,'')),
port : Array.isArray(port) ? port : host.split(',').map(x => parseInt(new URL(x).port || port)),
host : Array.isArray(host) ? host : host.split(',').map(x => new URL("s://"+x).hostname.replace(/[\[\]]/g,'')),
port : Array.isArray(port) ? port : host.split(',').map(x => parseInt(new URL("s://"+x).port || port)),
path : o.path || host.indexOf('/') > -1 && host + '/.s.PGSQL.' + port,
database : o.database || o.db || (url.pathname || '').slice(1) || env.PGDATABASE || user,
user : user,
Expand Down

0 comments on commit b88c3b5

Please sign in to comment.