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 +3 -0
- package/lib/utils.js +3 -4
- package/package.json +1 -1
package/lib/parser.js
CHANGED
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() ||
|
|
133
|
+
return ((str || "").trim() || "");
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
|