Comparing version 2.7.4 to 2.8.0
@@ -174,4 +174,6 @@ 'use strict' | ||
for (let i = 0; i < this._queue.length; i++) { | ||
this._queue.pop()[1](msg) | ||
const queuedCallback = this._queue[i][1] | ||
queuedCallback.call(this, msg) | ||
} | ||
this._queue.length = 0 | ||
@@ -178,0 +180,0 @@ if (this.listenerCount('error') > 0) { |
{ | ||
"name": "pg-cursor", | ||
"version": "2.7.4", | ||
"version": "2.8.0", | ||
"description": "Query cursor extension for node-postgres", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"mocha": "^7.1.2", | ||
"pg": "^8.8.0" | ||
"pg": "^8.9.0" | ||
}, | ||
@@ -27,3 +27,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c99fb2c127ddf8d712500db2c7b9a5491a178655" | ||
"gitHead": "20a243e8b30926a348cafc44177e95345618f7bc" | ||
} |
@@ -22,2 +22,19 @@ 'use strict' | ||
}) | ||
it('errors queued reads', async () => { | ||
const client = new pg.Client() | ||
await client.connect() | ||
const cursor = client.query(new Cursor('asdfdffsdf')) | ||
const immediateRead = cursor.read(1) | ||
const queuedRead1 = cursor.read(1) | ||
const queuedRead2 = cursor.read(1) | ||
assert(await immediateRead.then(() => null, (err) => err)) | ||
assert(await queuedRead1.then(() => null, (err) => err)) | ||
assert(await queuedRead2.then(() => null, (err) => err)) | ||
client.end() | ||
}) | ||
}) | ||
@@ -24,0 +41,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26715
776