Skip to content

Commit 410b89b

Browse files
committed
Allow password option to be non-enumerable
to avoid breaking uses like `new Pool(existingPool.options)`.
1 parent fa1d44a commit 410b89b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/pg-pool/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ class Pool extends EventEmitter {
6161
super()
6262
this.options = Object.assign({}, options)
6363

64-
if ('password' in this.options) {
65-
const password = this.options.password
64+
if (options != null && 'password' in options) {
6665
// "hiding" the password so it doesn't show up in stack traces
6766
// or if the client is console.logged
6867
Object.defineProperty(this.options, 'password', {
6968
configurable: true,
7069
enumerable: false,
71-
value: password,
70+
value: options.password,
7271
writable: true
7372
})
7473
}

0 commit comments

Comments
 (0)