imapflow 1.0.135 → 1.0.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 1.0.136 - 2023-08-15
4
+
5
+ - Added missing destroySoon method for the PassThrough writable socket
6
+
3
7
  - 1.0.135 - 2023-07-29
4
8
 
5
9
  - Improved handling of unexpected close
package/lib/imap-flow.js CHANGED
@@ -725,6 +725,22 @@ class ImapFlow extends EventEmitter {
725
725
  // route outgoing socket via deflate stream
726
726
  this.writeSocket = new PassThrough();
727
727
 
728
+ this.writeSocket.destroySoon = () => {
729
+ try {
730
+ if (this.socket) {
731
+ this.socket.destroySoon();
732
+ }
733
+ this.writeSocket.end();
734
+ } catch (err) {
735
+ this.log.error({ err, info: 'Failed to destroy PassThrough socket', cid: this.id });
736
+ throw err;
737
+ }
738
+ };
739
+
740
+ Object.defineProperty(this.writeSocket, 'destroyed', {
741
+ get: () => this.socket.destroyed
742
+ });
743
+
728
744
  // we need to force flush deflated data to socket so we can't
729
745
  // use normal pipes for this.writeSocket -> this._deflate -> this.socket
730
746
  let reading = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.135",
3
+ "version": "1.0.136",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -27,15 +27,15 @@
27
27
  },
28
28
  "homepage": "https://imapflow.com/",
29
29
  "devDependencies": {
30
- "@babel/eslint-parser": "7.22.9",
31
- "@babel/eslint-plugin": "7.22.5",
30
+ "@babel/eslint-parser": "7.22.10",
31
+ "@babel/eslint-plugin": "7.22.10",
32
32
  "@babel/plugin-syntax-class-properties": "7.12.13",
33
- "@babel/preset-env": "7.22.9",
34
- "@types/node": "20.4.5",
33
+ "@babel/preset-env": "7.22.10",
34
+ "@types/node": "20.5.0",
35
35
  "braintree-jsdoc-template": "3.3.0",
36
- "eslint": "8.46.0",
36
+ "eslint": "8.47.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
- "eslint-config-prettier": "8.9.0",
38
+ "eslint-config-prettier": "9.0.0",
39
39
  "grunt": "1.6.1",
40
40
  "grunt-cli": "1.4.3",
41
41
  "grunt-contrib-nodeunit": "5.0.0",
@@ -52,7 +52,7 @@
52
52
  "libqp": "2.0.1",
53
53
  "mailsplit": "5.4.0",
54
54
  "nodemailer": "6.9.4",
55
- "pino": "8.14.2",
55
+ "pino": "8.15.0",
56
56
  "socks": "2.7.1"
57
57
  }
58
58
  }