Skip to content

Commit b664f8c

Browse files
lib: refactor addEllipsis function to remove unused parameter
1 parent fbb356c commit b664f8c

File tree

2 files changed

+379
-132
lines changed

2 files changed

+379
-132
lines changed

lib/internal/assert/assertion_error.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ function createErrDiff(actual, expected, operator, customMessage, diffType = 'si
231231
return `${headerMessage}${skippedMessage}\n${message}\n`;
232232
}
233233

234-
function addEllipsis(string, diff) {
235-
if (diff === 'full') return string;
234+
function addEllipsis(string) {
236235
const lines = StringPrototypeSplit(string, '\n', 11);
237236
if (lines.length > 10) {
238237
lines.length = 10;
@@ -392,10 +391,10 @@ class AssertionError extends Error {
392391
const tmpExpected = this.expected;
393392

394393
if (typeof this.actual === 'string') {
395-
this.actual = addEllipsis(this.actual, this.diff);
394+
this.actual = addEllipsis(this.actual);
396395
}
397396
if (typeof this.expected === 'string') {
398-
this.expected = addEllipsis(this.expected, this.diff);
397+
this.expected = addEllipsis(this.expected);
399398
}
400399

401400
// This limits the `actual` and `expected` property default inspection to

0 commit comments

Comments
 (0)