How to use the util function from protobufjs
Find comprehensive JavaScript protobufjs.util code examples handpicked from public code repositorys.
16 17 18 19 20 21 22 23 24 25
module.exports = require('./bundle.js'); // Allow client code to translate the obscure uint64 field format to/from a number module.exports.numberToUint64 = protobuf.util.longToHash; module.exports.uint64ToNumber = (uint64Value) => { const value = protobuf.util.longFromHash(uint64Value, true); return typeof value === 'number' ? value : value.toInt(); } // Build the services
525
774
63
+ 7 other calls in file
GitHub: agreatfool/SASDN
15 16 17 18 19 20 21 22 23 24 25
OneOf = protobuf.OneOf, Enum = protobuf.Enum, Service = protobuf.Service, Method = protobuf.Method, types = protobuf.types, util = protobuf.util; var base10Re = /^[1-9][0-9]*$/, base10NegRe = /^-?[1-9][0-9]*$/, base16Re = /^0[x][0-9a-fA-F]+$/,
6
8
0
+ 3 other calls in file
GitHub: alibaba-archive/antpb
9 10 11 12 13 14 15 16 17 18 19
const common = protobuf.common; const Type = protobuf.Type; const Root = protobuf.Root; const Reader = protobuf.Reader; const Writer = protobuf.Writer; const util = protobuf.util; const verifier = protobuf.verifier; const wrappers = protobuf.wrappers; const originalSetup = Type.prototype.setup;
1
3
0
2695 2696 2697 2698 2699 2700 2701 2702 2703 2704
/** * Reconfigures the library according to the environment. * @returns {undefined} */ function configure() { protobuf.util._configure(); protobuf.Writer._configure(protobuf.BufferWriter); protobuf.Reader._configure(protobuf.BufferReader); }
0
1
0
+ 2 other calls in file
GitHub: King5-12/xiu-cli
20 21 22 23 24 25 26 27 28 29
const root = new protobufjs.Root(); const paths = []; // paths.push(path.relative(process.cwd(), path.join(__dirname, '..')) || '.'); paths.push(process.cwd()); root.resolvePath = (origin, target) => { const normOrigin = protobufjs.util.path.normalize(origin), normTarget = protobufjs.util.path.normalize(target); let resolved = protobufjs.util.path.resolve( normOrigin, normTarget,
0
0
1
+ 119 other calls in file
264 265 266 267 268 269 270 271 272 273
//Make this prettier try { this.realTimeData = this.GTFSRealTimeMessage.decode(buffer); this.realTimeLastModified = Number.parseInt(this.realTimeData.header.timestamp); } catch (e) { if (e instanceof protobuf.util.ProtocolError) { console.error("Protocol buffer protocol error"); } else { console.error("Protocol buffer wire format is invalid"); }
0
0
1
+ 29 other calls in file
protobufjs.load is the most popular function in protobufjs (282 examples)