Skip to content

Commit

Permalink
Also validate map fields, see #526 (this really needs some tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 9, 2016
1 parent 22200ae commit 4157a0e
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 58 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ JSON to/from buffer x 89,854 ops/sec ±0.79% (93 runs sampled)
Type to/from buffer was fastest
JSON to/from string was 49.0% slower
JSON to/from buffer was 63.9% slower
benchmarking verifying performance ...
Type.verify x 5,941,014 ops/sec ±0.96% (90 runs sampled)
Type.verify was fastest
```

Note that JSON is a native binding nowadays and as such is about as fast as it possibly can get. So, how can protobuf.js be faster?
Expand Down
4 changes: 3 additions & 1 deletion cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ 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", codegen.verify.generate(type), {
util : "$protobuf.util"
});
}

function buildService(ref, service) {
Expand Down
139 changes: 112 additions & 27 deletions dist/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/protobuf.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4157a0e

Please sign in to comment.