Permalink
Browse files

pbjs descriptor.proto compatibility; always use Uint8Array in docs fo…

…r tsd, see #503
  • Loading branch information...
dcodeIO committed Nov 30, 2016
1 parent 29ff3f1 commit 6a06e95222d741c47a51bcec85cd20317de7c0b0
@@ -144,6 +144,18 @@ function buildEnum(enm) {
push("}");
}
function buildRanges(keyword, ranges) {
if (ranges && ranges.length) {
push("");
ranges.forEach(function(range) {
if (range[0] === range[1])
push(keyword + " " + range[0] + ";");
else
push(keyword + " " + range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1]) + ";");
});
}
}
function buildType(type) {
push("");
push("message " + type.name + " {");
@@ -153,12 +165,8 @@ function buildType(type) {
first = true;
type.fieldsArray.forEach(build);
consolidateExtends(type.nestedArray).remaining.forEach(build);
if (type.extensions && type.extensions.length) {
push("");
type.extensions.forEach(function(range) {
push("extensions " + range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1]) + ";");
});
}
buildRanges("extensions", type.extensions);
buildRanges("reserved", type.reserved);
--indent;
push("}");
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN +60 Bytes (100%) dist/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1 @@
This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required.
Oops, something went wrong.

0 comments on commit 6a06e95

Please sign in to comment.