How to use the google-protobuf.Map function in google-protobuf

To help you get started, we’ve selected a few google-protobuf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ArcBlock / forge-js / forge / forge-message / lib / patch.js View on Github external
/* eslint-disable */
/**
 * This patch fixes an issue in `google-protobuf` package
 * After this patch is applied: The deserialize of `map` fields can accept empty values
 */
const assert = require('assert');
const jspb = require('google-protobuf');
const debug = require('debug')(`${require('../package.json').name}:Map`);

// FIXME: remove this patch when `google-protobuf` is enable to handle this
// @link https://github.com/protocolbuffers/protobuf/blob/46a48e49aa/js/map.js#L469
if (typeof jspb.Map.deserializeBinary === 'function' && !jspb.Map.deserializeBinary.__patched__) {
  jspb.Map.deserializeBinary = function (
    map,
    reader,
    keyReaderFn,
    valueReaderFn,
    opt_valueReaderCallback,
    opt_defaultKey = 0
  ) {
    let key = opt_defaultKey;
    let value;

    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      const field = reader.getFieldNumber();
github SeldonIO / seldon-core / incubating / wrappers / s2i / nodejs / prediction_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader);
         });
      break;
github agreatfool / grpc_tools_node_protoc_ts / examples / build / proto / book_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString, null, 0);
         });
      break;
github pulumi / pulumi / sdk / nodejs / proto / language_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString);
         });
      break;
github pulumi / pulumi / sdk / nodejs / proto / languages_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString);
         });
      break;
github agreatfool / SASDN / src / proto / book_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString);
         });
      break;
github Opteo / google-ads-node / src / protos / google / api / monitored_resource_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "");
         });
      break;
github agreatfool / grpc_tools_node_protoc_ts / proto / book_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readString);
         });
      break;
github projectriff / node-function-invoker / codegen / proto / riff-rpc_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "");
         });
      break;
github citahub / cita-sdk-js / packages / cita-signer / proto-js / blockchain_pb.js View on Github external
reader.readMessage(value, function(message, reader) {
        jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint64);
         });
      break;

google-protobuf

Protocol Buffers for JavaScript

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis