Flesh out util_stub a little more
This commit is contained in:
parent
2fcd2806ab
commit
212a92605e
|
@ -378,7 +378,7 @@ Index.prototype.sendMessage = function(v, leafCallback) {
|
||||||
|
|
||||||
Node.prototype._debugString = function (outerIndent) {
|
Node.prototype._debugString = function (outerIndent) {
|
||||||
const pieces = [];
|
const pieces = [];
|
||||||
const inspect = require('util').inspect || JSON.stringify;
|
const inspect = require('util').inspect;
|
||||||
function line(indent, content) {
|
function line(indent, content) {
|
||||||
pieces.push(indent);
|
pieces.push(indent);
|
||||||
pieces.push(content);
|
pieces.push(content);
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inspect: void 0,
|
inspect: (item) => {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(item);
|
||||||
|
} catch (_e) {
|
||||||
|
return '<uninspectable_value>';
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.inspect.custom = Symbol('util_stub.inspect.custom');
|
||||||
|
|
Loading…
Reference in New Issue