Skip to content

Commit

Permalink
style: automatic fixes for new ESLint rules
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Locke <[email protected]>
  • Loading branch information
kevinoid committed May 7, 2023
1 parent 4b86d9a commit ea3b10d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,7 @@ InflateAuto.prototype._queueMethodCall = function _queueMethodCall(name, args) {
queueMicrotask(lastArg);
}

if (!this._queuedMethodCalls) {
this._queuedMethodCalls = [];
}
this._queuedMethodCalls ||= [];
this._queuedMethodCalls.push({ name, args });
};

Expand Down
4 changes: 1 addition & 3 deletions lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ let excludedStackFn;

let internalUtilInspect = null;
function lazyInternalUtilInspect() {
if (!internalUtilInspect) {
internalUtilInspect = require('util');
}
internalUtilInspect ||= require('util');
return internalUtilInspect;
}

Expand Down
10 changes: 4 additions & 6 deletions test-lib/assert-error-equal.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ function assertErrorEqual(actual, expected, message) {
const actualInstanceOf = actual instanceof builtInError;
const expectedInstanceOf = expected instanceof builtInError;
if (actualInstanceOf !== expectedInstanceOf) {
if (!message) {
message = `Expected "actual" and "expected" to be instanceof ${
builtInError.prototype.name}: actual ${
actualInstanceOf ? 'is' : 'is not'}, expected ${
expectedInstanceOf ? 'is' : 'is not'}.`;
}
message ||= `Expected "actual" and "expected" to be instanceof ${
builtInError.prototype.name}: actual ${
actualInstanceOf ? 'is' : 'is not'}, expected ${
expectedInstanceOf ? 'is' : 'is not'}.`;
throw new AssertionError({
actual,
expected,
Expand Down

0 comments on commit ea3b10d

Please sign in to comment.