Skip to content

Commit

Permalink
Use symbol for custom util.inspect function (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritbh authored and abalabahaha committed Jun 12, 2018
1 parent 1334ec8 commit 7aae930
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/structures/Base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

const util = require('util');

class Base {
constructor(id) {
if(id) {
Expand Down Expand Up @@ -64,4 +66,9 @@ class Base {
}
}

// Node 6+ util.custom.inspect symbol support - https://github.com/nodejs/node/issues/15549
if(util.inspect.custom) {
Base.prototype[util.inspect.custom] = Base.prototype.inspect;
}

module.exports = Base;

0 comments on commit 7aae930

Please sign in to comment.