postal-mime 2.0.1 → 2.0.2

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.
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ printWidth: 160,
3
+ tabWidth: 4,
4
+ singleQuote: true,
5
+ endOfLine: 'lf',
6
+ trailingComma: 'none',
7
+ arrowParens: 'avoid'
8
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.2](https://github.com/postalsys/postal-mime/compare/v2.0.1...v2.0.2) (2023-12-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **test:** Added a tests runner and some tests ([8c6f7fb](https://github.com/postalsys/postal-mime/commit/8c6f7fb495b0158756fc11482a717e8081cede86))
9
+ * **test:** Added test action ([c43c086](https://github.com/postalsys/postal-mime/commit/c43c0865dae74a7f20e32885a5860d8654f0c932))
10
+
3
11
  ## [2.0.1](https://github.com/postalsys/postal-mime/compare/v2.0.0...v2.0.1) (2023-11-05)
4
12
 
5
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postal-mime",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Email parser for browser environments",
5
5
  "main": "./src/postal-mime.js",
6
6
  "exports": {
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "types": "postal-mime.d.ts",
11
11
  "scripts": {
12
- "test": "eslint",
12
+ "test": "eslint && node --test",
13
13
  "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
14
14
  },
15
15
  "keywords": [
@@ -27,9 +27,9 @@
27
27
  "license": "MIT-0",
28
28
  "devDependencies": {
29
29
  "cross-blob": "3.0.2",
30
- "eslint": "8.52.0",
30
+ "eslint": "8.55.0",
31
31
  "eslint-cli": "1.1.1",
32
- "iframe-resizer": "4.3.7",
32
+ "iframe-resizer": "4.3.9",
33
33
  "cross-env": "7.0.3"
34
34
  }
35
35
  }
package/postal-mime.d.ts CHANGED
@@ -23,7 +23,7 @@ export type Email = {
23
23
  replyTo?: Address[];
24
24
  deliveredTo?: string;
25
25
  returnPath?: string;
26
- to: Address[];
26
+ to?: Address[];
27
27
  cc?: Address[];
28
28
  bcc?: Address[];
29
29
  subject?: string;
@@ -109,6 +109,14 @@ function _handleAddress(tokens) {
109
109
  data.text = data.text.join(' ');
110
110
  data.address = data.address.join(' ');
111
111
 
112
+ if (!data.address && /^=\?[^=]+?=$/.test(data.text.trim())) {
113
+ // try to extract words from text content
114
+ const parsedSubAddresses = addressParser(decodeWords(data.text));
115
+ if (parsedSubAddresses && parsedSubAddresses.length) {
116
+ return parsedSubAddresses;
117
+ }
118
+ }
119
+
112
120
  if (!data.address && isGroup) {
113
121
  return [];
114
122
  } else {
File without changes