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