Permalink
Browse files

Restructured reusable micromodules

  • Loading branch information...
dcodeIO committed Dec 10, 2016
1 parent b510ba2 commit 14c207ed6e05a61e756fa4192efb2fa219734dd6
@@ -22,7 +22,7 @@ var protobuf = require("../src/index"),
var root = protobuf.loadSync(require.resolve("./bench.proto"));
var Test = root.lookup("Test");
protobuf.codegen.verbose = true;
protobuf.util.codegen.verbose = true;
var buf = Test.encode(data).finish();
@@ -9,8 +9,7 @@ var Type = protobuf.Type,
Service = protobuf.Service,
Enum = protobuf.Enum,
Namespace = protobuf.Namespace,
util = protobuf.util,
codegen = protobuf.codegen;
util = protobuf.util;
var out = [];
var indent = 0;
@@ -232,7 +231,7 @@ function buildType(ref, type) {
"@param {Writer} [writer] Writer to encode to",
"@returns {Writer} Writer"
]);
buildFunction(type, "encode", codegen.encode.generate(type), {
buildFunction(type, "encode", protobuf.encode.generate(type), {
Writer : "$protobuf.Writer",
util : "$protobuf.util"
});
@@ -260,7 +259,7 @@ function buildType(ref, type) {
"@param {number} [length] Message length if known beforehand",
"@returns {" + fullName + "} " + type.name
]);
buildFunction(type, "decode", codegen.decode.generate(type), {
buildFunction(type, "decode", protobuf.decode.generate(type), {
Reader : "$protobuf.Reader",
util : "$protobuf.util"
});
@@ -286,7 +285,7 @@ function buildType(ref, type) {
"@param {" + fullName + "|Object} message " + type.name + " or plain object to verify",
"@returns {?string} `null` if valid, otherwise the reason why it is not"
]);
buildFunction(type, "verify", codegen.verify.generate(type), {
buildFunction(type, "verify", protobuf.verify.generate(type), {
util : "$protobuf.util"
});
}
Oops, something went wrong.

0 comments on commit 14c207e

Please sign in to comment.