proto3-json-serializer
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -114,2 +114,6 @@ "use strict"; | ||
value === null) { | ||
if (typeof value === 'number' && !Number.isFinite(value)) { | ||
result[key] = value.toString(); | ||
continue; | ||
} | ||
result[key] = value; | ||
@@ -116,0 +120,0 @@ continue; |
@@ -38,2 +38,5 @@ "use strict"; | ||
typeof obj.numberValue === 'number') { | ||
if (!Number.isFinite(obj.numberValue)) { | ||
return obj.numberValue.toString(); | ||
} | ||
return obj.numberValue; | ||
@@ -40,0 +43,0 @@ } |
@@ -30,2 +30,6 @@ "use strict"; | ||
} | ||
// JSON accept special string values "NaN", "Infinity", and "-Infinity". | ||
if (typeof obj.value === 'number' && !Number.isFinite(obj.value)) { | ||
return obj.value.toString(); | ||
} | ||
return obj.value; | ||
@@ -32,0 +36,0 @@ } |
# Changelog | ||
### [0.1.5](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.4...v0.1.5) (2021-10-26) | ||
### Bug Fixes | ||
* JSON accept special string for NaN, Infinity ([#19](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/19)) ([01a345b](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/01a345b7b1d62ee65a8673737975980d274fa22a)) | ||
### [0.1.4](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.3...v0.1.4) (2021-09-20) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "proto3-json-serializer", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"repository": "googleapis/proto3-json-serializer-nodejs", | ||
@@ -40,3 +40,3 @@ "description": "Support for proto3 JSON serialiazation/deserialization for protobuf.js", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^14.11.2", | ||
"@types/node": "^16.0.0", | ||
"c8": "^7.7.3", | ||
@@ -43,0 +43,0 @@ "google-proto-files": "^2.4.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78461
921