Browser doesn't have util
This commit is contained in:
parent
8d3146cf30
commit
3c059a573c
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "preserves",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Experimental data serialization format",
|
||||
"homepage": "https://gitlab.com/preserves/preserves",
|
||||
"license": "Apache-2.0",
|
||||
|
|
|
@ -257,9 +257,11 @@ Bytes.prototype.toString = function () {
|
|||
return '#"' + this.__asciify() + '"';
|
||||
};
|
||||
|
||||
Bytes.prototype[util.inspect.custom] = function (depth, options) {
|
||||
return this.toString();
|
||||
};
|
||||
if (util.inspect) {
|
||||
Bytes.prototype[util.inspect.custom] = function (depth, options) {
|
||||
return this.toString();
|
||||
};
|
||||
}
|
||||
|
||||
Bytes.prototype.__asciify = function () {
|
||||
const pieces = [];
|
||||
|
@ -356,7 +358,7 @@ Record.prototype.toString = function () {
|
|||
try {
|
||||
return "" + f;
|
||||
} catch (e) {
|
||||
return util.inspect(f);
|
||||
return (util.inspect || ((f) => '<unprintable_preserves_field_value>'))(f);
|
||||
}
|
||||
}).join(', ') + ')';
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue