email-forward-parser 1.5.6 → 1.5.8

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 CHANGED
@@ -1086,6 +1086,9 @@ class Parser {
1086
1086
  _address = null;
1087
1087
  }
1088
1088
 
1089
+ _address = _address || null;
1090
+ _name = _name || null;
1091
+
1089
1092
  return {
1090
1093
  address : _address,
1091
1094
 
package/lib/utils.js CHANGED
@@ -23,6 +23,8 @@ var loopRegexes = function(
23
23
  regexes, str, mode = "match", highestPosition = true
24
24
  ) {
25
25
  var _match;
26
+ var _maxLength = str.length;
27
+ var _minLength = mode === "split" ? 1 : 0;
26
28
 
27
29
  for (var _i = 0; _i < regexes.length; _i++) {
28
30
  var _regex = regexes[_i];
@@ -40,14 +42,11 @@ var loopRegexes = function(
40
42
  _match = _currentMatch;
41
43
 
42
44
  // A successfull replace must return a smaller string than the input
43
- var _maxLength = str.length;
44
-
45
45
  if (_match.length < _maxLength) {
46
46
  break;
47
47
  }
48
48
  } else if (mode === "split" || mode === "match") {
49
49
  // A successfull split must return an array with at least two items
50
- var _minLength = mode === "split" ? 1 : 0;
51
50
 
52
51
  if ((_currentMatch || []).length > _minLength) {
53
52
  if (highestPosition === true) {
@@ -131,7 +130,7 @@ var reconciliateSplitMatch = function(
131
130
  * @return {string} The trimed string
132
131
  */
133
132
  var trimString = function(str) {
134
- return ((str || "").trim() || null)
133
+ return ((str || "").trim() || "");
135
134
  }
136
135
 
137
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-forward-parser",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Parses forwarded emails and extract content",
5
5
  "author": "Eliott Vincent <eliott@crisp.chat>",
6
6
  "main": "lib/index.js",