Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

proto3-json-serializer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proto3-json-serializer - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

build/src/fromproto3json.js

@@ -116,3 +116,3 @@ "use strict";

else if (fieldType.match(/^(?:(?:(?:u?int|fixed)(?:32|64))|float|double)$/)) {
if (typeof value !== 'number') {
if (typeof value !== 'number' && typeof value !== 'string') {
throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`);

@@ -119,0 +119,0 @@ }

@@ -119,3 +119,3 @@ "use strict";

assert(value.constructor.name === 'Long', `toProto3JSON: don't know how to convert field ${key} with value ${value}`);
result[key] = value.toNumber();
result[key] = value.toString();
continue;

@@ -122,0 +122,0 @@ }

@@ -12,3 +12,3 @@ /// <reference types="node" />

export interface LongStub {
toNumber: () => number;
toString: () => string;
}

@@ -28,3 +28,3 @@ "use strict";

assert(obj.value.constructor.name === 'Long', `wrapperToProto3JSON: expected to see a number, a string, a boolean, or a Long, but got ${obj.value}`);
return obj.value.toNumber();
return obj.value.toString();
}

@@ -31,0 +31,0 @@ return obj.value;

# Changelog
### [0.1.1](https://www.github.com/googleapis/proto3-json-serializer-nodejs/compare/v0.1.0...v0.1.1) (2021-08-04)
### Bug Fixes
* accept and return strings for int64 and uint64 ([#7](https://www.github.com/googleapis/proto3-json-serializer-nodejs/issues/7)) ([35689ec](https://www.github.com/googleapis/proto3-json-serializer-nodejs/commit/35689ecee55dbe6e4cf3327c535514d7fcb8332d))
## 0.1.0 (2021-08-03)

@@ -4,0 +11,0 @@

{
"name": "proto3-json-serializer",
"version": "0.1.0",
"version": "0.1.1",
"repository": "googleapis/proto3-json-serializer-nodejs",

@@ -5,0 +5,0 @@ "description": "Support for proto3 JSON serialiazation/deserialization for protobuf.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc