imapflow 1.0.179 → 1.0.181

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.181](https://github.com/postalsys/imapflow/compare/v1.0.180...v1.0.181) (2025-02-06)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **parser:** Fixed DIGIT handling' ([75389f1](https://github.com/postalsys/imapflow/commit/75389f12036cf746e7fa490843d27ade26fe1e78))
9
+
10
+ ## [1.0.180](https://github.com/postalsys/imapflow/compare/v1.0.179...v1.0.180) (2025-02-06)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **tls:** If socket fails then clear upgrade timeout as well ([12c60d2](https://github.com/postalsys/imapflow/commit/12c60d23d46d3bb315ecb184fbd1eea709f93269))
16
+
3
17
  ## [1.0.179](https://github.com/postalsys/imapflow/compare/v1.0.178...v1.0.179) (2025-01-28)
4
18
 
5
19
 
@@ -65,7 +65,7 @@ module.exports = {
65
65
  },
66
66
 
67
67
  DIGIT() {
68
- let value = expandRange(0x30, 0x39) + expandRange(0x61, 0x7a);
68
+ let value = expandRange(0x30, 0x39);
69
69
  this.DIGIT = function () {
70
70
  return value;
71
71
  };
@@ -210,7 +210,7 @@ class TokenParser {
210
210
  case '~': {
211
211
  let nextChr = this.str.charAt(i + 1);
212
212
  if (nextChr !== '{') {
213
- if (imapFormalSyntax['ATOM-CHAR']().indexOf(nextChr)) {
213
+ if (imapFormalSyntax['ATOM-CHAR']().indexOf(nextChr) >= 0) {
214
214
  // treat as ATOM
215
215
  this.currentNode = this.createNode(this.currentNode, this.pos + i);
216
216
  this.currentNode.type = 'ATOM';
@@ -433,7 +433,7 @@ class TokenParser {
433
433
  case STATE_PARTIAL:
434
434
  if (chr === '>') {
435
435
  if (this.currentNode.value.at(-1) === '.') {
436
- let error = new Error(`Unexpected end of partial at position ${this.pos + 1} [E19]`);
436
+ let error = new Error(`Unexpected end of partial at position ${this.pos + i} [E19]`);
437
437
  error.code = 'ParserError19';
438
438
  error.parserContext = { input: this.str, pos: this.pos + i, chr };
439
439
  throw error;
@@ -447,7 +447,7 @@ class TokenParser {
447
447
  }
448
448
 
449
449
  if (chr === '.' && (!this.currentNode.value.length || this.currentNode.value.match(/\./))) {
450
- let error = new Error(`Unexpected partial separator . at position ${this.pos + 1} [E20]`);
450
+ let error = new Error(`Unexpected partial separator . at position ${this.pos + i} [E20]`);
451
451
  error.code = 'ParserError20';
452
452
  error.parserContext = { input: this.str, pos: this.pos + i, chr };
453
453
  throw error;
package/lib/imap-flow.js CHANGED
@@ -971,6 +971,7 @@ class ImapFlow extends EventEmitter {
971
971
 
972
972
  socketPlain.once('error', err => {
973
973
  clearTimeout(this.connectTimeout);
974
+ clearTimeout(this.upgradeTimeout);
974
975
  if (!this.upgrading) {
975
976
  // don't care anymore
976
977
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.179",
3
+ "version": "1.0.181",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -31,8 +31,8 @@
31
31
  "@babel/eslint-parser": "7.26.5",
32
32
  "@babel/eslint-plugin": "7.25.9",
33
33
  "@babel/plugin-syntax-class-properties": "7.12.13",
34
- "@babel/preset-env": "7.26.0",
35
- "@types/node": "22.10.8",
34
+ "@babel/preset-env": "7.26.7",
35
+ "@types/node": "22.13.1",
36
36
  "eslint": "8.57.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
38
  "eslint-config-prettier": "9.1.0",