Skip to content

Commit 2997d4d

Browse files
committed
npm release
1 parent 10d1e32 commit 2997d4d

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

cf/polyfills.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@ export const crypto = {
4848
createHash: type => ({
4949
update: x => ({
5050
digest: encoding => {
51-
if (!(x instanceof Uint8Array)) {
51+
if (!(x instanceof Uint8Array))
5252
x = textEncoder.encode(x)
53-
}
53+
5454
let prom
55-
if (type === 'sha256') {
55+
if (type === 'sha256')
5656
prom = Crypto.subtle.digest('SHA-256', x)
57-
} else if (type === 'md5') {
57+
else if (type === 'md5')
5858
prom = Crypto.subtle.digest('md5', x)
59-
} else {
59+
else
6060
throw Error('createHash only supports sha256 or md5 in this environment, not ${type}.')
61-
}
62-
if (encoding === 'hex') {
61+
62+
if (encoding === 'hex')
6363
return prom.then((arrayBuf) => Buffer.from(arrayBuf).toString('hex'))
64-
} else if (encoding) {
64+
else if (encoding)
6565
throw Error(`createHash only supports hex encoding or unencoded in this environment, not ${encoding}`)
66-
} else {
66+
else
6767
return prom
68-
}
68+
6969
}
7070
})
7171
}),

cf/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ function parseOptions(a, b) {
457457
}
458458

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

cjs/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ function parseOptions(a, b) {
456456
}
457457

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

cjs/tests/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const crypto = require('crypto')
88
const postgres = require('../src/index.js')
99
const delay = ms => new Promise(r => setTimeout(r, ms))
1010

11-
const rel = x => require("path").join(__dirname, x)
11+
const rel = x => require('path').join(__dirname, x)
1212
const idle_timeout = 1
1313

1414
const login = {

deno/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ function parseOptions(a, b) {
457457
}
458458

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

deno/tests/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2583,4 +2583,4 @@ t('arrays in reserved connection', async() => {
25832583
]
25842584
})
25852585

2586-
;globalThis.addEventListener("unload", () => Deno.exit(process.exitCode))
2586+
globalThis.addEventListener('unload', () => Deno.exit(process.exitCode))

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ function parseOptions(a, b) {
456456
}
457457

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

0 commit comments

Comments
 (0)