diff --git a/packages/protobuf-bench/README.md b/packages/protobuf-bench/README.md index fe1e3f448..737f0a16e 100644 --- a/packages/protobuf-bench/README.md +++ b/packages/protobuf-bench/README.md @@ -10,5 +10,5 @@ server would usually do. | code generator | bundle size | minified | compressed | |---------------------|------------------------:|-----------------------:|-------------------:| -| protobuf-es | 88,672 b | 37,773 b | 9,865 b | +| protobuf-es | 88,669 b | 37,770 b | 9,843 b | | protobuf-javascript | 394,384 b | 288,761 b | 45,123 b | diff --git a/packages/protobuf/src/private/json-format-common.ts b/packages/protobuf/src/private/json-format-common.ts index e13b4e439..a1f0d5b0d 100644 --- a/packages/protobuf/src/private/json-format-common.ts +++ b/packages/protobuf/src/private/json-format-common.ts @@ -328,7 +328,7 @@ export function makeJsonFormatCommon( }; } -function debugJsonValue(json: JsonValue): string { +function debugJsonValue(json: unknown): string { if (json === null) { return "null"; } @@ -338,7 +338,7 @@ function debugJsonValue(json: JsonValue): string { case "string": return json.length > 100 ? "string" : `"${json.split('"').join('\\"')}"`; default: - return json.toString(); + return String(json); } }