email-forward-parser 1.0.21 → 1.0.22
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/lib/parser.js +5 -13
- package/package.json +1 -1
package/lib/parser.js
CHANGED
|
@@ -568,7 +568,7 @@ class Parser {
|
|
|
568
568
|
var _author = this.__parseMailbox(this.__regexes.original_from, text);
|
|
569
569
|
|
|
570
570
|
// Author found?
|
|
571
|
-
if (_author.address) {
|
|
571
|
+
if ((_author || {}).address) {
|
|
572
572
|
return _author;
|
|
573
573
|
}
|
|
574
574
|
|
|
@@ -636,9 +636,7 @@ class Parser {
|
|
|
636
636
|
);
|
|
637
637
|
|
|
638
638
|
// Recipient(s) found?
|
|
639
|
-
if (Array.isArray(_recipients) &&
|
|
640
|
-
!(_recipients[0].address === null && _recipients[0].name === null)
|
|
641
|
-
) {
|
|
639
|
+
if (Array.isArray(_recipients) && _recipients.length > 0) {
|
|
642
640
|
return _recipients;
|
|
643
641
|
}
|
|
644
642
|
|
|
@@ -692,9 +690,7 @@ class Parser {
|
|
|
692
690
|
);
|
|
693
691
|
|
|
694
692
|
// Recipient(s) found?
|
|
695
|
-
if (Array.isArray(_recipients) &&
|
|
696
|
-
!(_recipients[0].address === null && _recipients[0].name === null)
|
|
697
|
-
) {
|
|
693
|
+
if (Array.isArray(_recipients) && _recipients.length > 0) {
|
|
698
694
|
return _recipients;
|
|
699
695
|
}
|
|
700
696
|
|
|
@@ -807,12 +803,8 @@ class Parser {
|
|
|
807
803
|
}
|
|
808
804
|
}
|
|
809
805
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
name : null
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
return (force_array === true) ? [_mailbox] : _mailbox;
|
|
806
|
+
// No mailbox found
|
|
807
|
+
return (force_array === true) ? [] : null;
|
|
816
808
|
}
|
|
817
809
|
|
|
818
810
|
|