Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit fe953c1

Browse files
blueloversvmx
authored andcommitted
feat: add nodejs.util.inspect.custom
1 parent 77292ef commit fe953c1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ class CID {
245245
return str
246246
}
247247

248+
/**
249+
* CID(QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n)
250+
*
251+
* @returns {String}
252+
*/
253+
[Symbol.for('nodejs.util.inspect.custom')] () {
254+
return 'CID(' + this.toString() + ')'
255+
}
256+
248257
toString (base) {
249258
return this.toBaseEncodedString(base)
250259
}

0 commit comments

Comments
 (0)