Skip to content

Commit

Permalink
Restructured reusable micromodules
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 10, 2016
1 parent b510ba2 commit 14c207e
Show file tree
Hide file tree
Showing 41 changed files with 2,594 additions and 1,365 deletions.
2 changes: 1 addition & 1 deletion bench/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
9 changes: 4 additions & 5 deletions cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
});
Expand Down Expand Up @@ -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"
});
Expand All @@ -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"
});
}
Expand Down
Loading

0 comments on commit 14c207e

Please sign in to comment.