Skip to content

Commit

Permalink
replace "util.inspect.custom" by global Symbol for more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
shlavik committed Sep 11, 2022
1 parent 5071636 commit 2c8bedb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/RateLimiterRes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const util = require('util');

module.exports = class RateLimiterRes {
constructor(remainingPoints, msBeforeNext, consumedPoints, isFirstInDuration) {
this.remainingPoints = typeof remainingPoints === 'undefined' ? 0 : remainingPoints; // Remaining points in current duration
Expand Down Expand Up @@ -52,7 +50,7 @@ module.exports = class RateLimiterRes {
};
}

[util.inspect.custom]() {
[Symbol.for("nodejs.util.inspect.custom")]() {
return this._getDecoratedProperties();
}

Expand Down

0 comments on commit 2c8bedb

Please sign in to comment.