imapflow 1.0.159 → 1.0.160

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.160](https://github.com/postalsys/imapflow/compare/v1.0.159...v1.0.160) (2024-04-22)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **copy:** Updated cipyright year to 2024 ([e3f5040](https://github.com/postalsys/imapflow/commit/e3f5040e8f90523e12108e978ac5002f8caa9e1e))
9
+
3
10
  ## [1.0.159](https://github.com/postalsys/imapflow/compare/v1.0.158...v1.0.159) (2024-04-12)
4
11
 
5
12
 
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020-2023 Postal Systems OÜ
1
+ Copyright (c) 2020-2024 Postal Systems OÜ
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -79,6 +79,6 @@ main().catch(err => console.error(err));
79
79
 
80
80
  ## License
81
81
 
82
- © 2020-2023 Postal Systems OÜ
82
+ © 2020-2024 Postal Systems OÜ
83
83
 
84
84
  Licensed under **MIT-license**
package/lib/imap-flow.js CHANGED
@@ -768,7 +768,11 @@ class ImapFlow extends EventEmitter {
768
768
  this.writeSocket.destroySoon = () => {
769
769
  try {
770
770
  if (this.socket) {
771
- this.socket.destroySoon();
771
+ if (typeof this.socket.destroySoon === "function") {
772
+ this.socket.destroySoon();
773
+ } else {
774
+ this.socket.destroy();
775
+ }
772
776
  }
773
777
  this.writeSocket.end();
774
778
  } catch (err) {
@@ -1480,7 +1484,11 @@ class ImapFlow extends EventEmitter {
1480
1484
 
1481
1485
  if (this.writeSocket && !this.writeSocket.destroyed) {
1482
1486
  try {
1483
- this.writeSocket.destroySoon();
1487
+ if (typeof this.writeSocket.destroySoon === "function") {
1488
+ this.writeSocket.destroySoon();
1489
+ } else {
1490
+ this.writeSocket.destroy();
1491
+ }
1484
1492
  } catch (err) {
1485
1493
  this.log.error({ err, cid: this.id });
1486
1494
  }
@@ -1488,7 +1496,11 @@ class ImapFlow extends EventEmitter {
1488
1496
 
1489
1497
  if (this.socket && !this.socket.destroyed && this.writeSocket !== this.socket) {
1490
1498
  try {
1491
- this.socket.destroySoon();
1499
+ if (typeof this.socket.destroySoon === "function") {
1500
+ this.socket.destroySoon();
1501
+ } else {
1502
+ this.socket.destroy();
1503
+ }
1492
1504
  } catch (err) {
1493
1505
  this.log.error({ err, cid: this.id });
1494
1506
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.159",
3
+ "version": "1.0.160",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {