Comparing version 2.2.0 to 2.3.0
@@ -147,8 +147,11 @@ /* errorex | ||
const a2 = ex.split(/\n/).filter(line => !!line.match(STACK_REGEXP)); | ||
/* Locate merge index */ | ||
for (let [i1, line] of a1.entries()) { | ||
const i2 = a2.indexOf(line); | ||
if (i2 >= 0) { | ||
/* Merge stack lines */ | ||
a1.splice(i1, 0, ...a2.slice(0, i2)); | ||
for (let k = 1; k <= a2.length; k++) { | ||
if (a2[a2.length - k] !== a1[a1.length - k]) { | ||
a2.splice(a1.length - k, a2.length); | ||
break; | ||
} | ||
} | ||
for (let k = 0; k < a1.length; k++) { | ||
if (a1[k].match(STACK_REGEXP)) { | ||
a1.splice(k, 0, ...a2); | ||
return a1.join('\n'); | ||
@@ -155,0 +158,0 @@ } |
{ | ||
"name": "errorex", | ||
"description": "'Extensible Error Class' implementation and predefined additional error types for javascript", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"author": "Panates Ltd.", | ||
@@ -25,3 +25,3 @@ "contributors": [ | ||
"eslint": "^5.12.1", | ||
"eslint-config-google": "^0.10.0", | ||
"eslint-config-google": "^0.11.0", | ||
"mocha": "^5.2.0", | ||
@@ -28,0 +28,0 @@ "nyc": "^13.1.0" |
10626
232