Skip to content

Commit

Permalink
Initial base64 string support for bytes fields, see #535
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 10, 2016
1 parent 7def340 commit a0398f5
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"complexity": 0, // is sometimes necessary
"consistent-return": 1,
"curly": 0, // sometimes more braces than code
"default-case": 1,
"default-case": 0, // just forces unnecessary code
"dot-location": 0, // looks nicer for chainables
"dot-notation": 1,
"eqeqeq": 1,
Expand Down
161 changes: 143 additions & 18 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.

4 changes: 2 additions & 2 deletions src/codegen/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function verifyValue(field, value) {
}

function verifyKey(field, value) {
switch (field.keyType) { // eslint-disable-line default-case
switch (field.keyType) {
case "int64":
case "uint64":
case "sint64":
Expand Down Expand Up @@ -213,7 +213,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {

function genVerifyKey(gen, field, ref) {
/* eslint-disable no-unexpected-multiline */
switch (field.keyType) { // eslint-disable-line default-case
switch (field.keyType) {
case "int64":
case "uint64":
case "sint64":
Expand Down
2 changes: 1 addition & 1 deletion src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var s_open = "{",
* @returns {ParserResult} Parser result
*/
function parse(source, root) {
/* eslint-disable default-case, callback-return */
/* eslint-disable callback-return */
if (!root)
root = new Root();

Expand Down
4 changes: 2 additions & 2 deletions src/tokenize.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function unescape(str) {
* @returns {TokenizerHandle} Tokenizer handle
*/
function tokenize(source) {
/* eslint-disable default-case, callback-return */
/* eslint-disable callback-return */
source = source.toString();

var offset = 0,
Expand Down Expand Up @@ -202,5 +202,5 @@ function tokenize(source) {
push: push,
skip: skip
};
/* eslint-enable default-case, callback-return */
/* eslint-enable callback-return */
}
2 changes: 1 addition & 1 deletion src/util/longbits.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ LongBits.fromNumber = function fromNumber(value) {
* @returns {util.LongBits} Instance
*/
LongBits.from = function from(value) {
switch (typeof value) { // eslint-disable-line default-case
switch (typeof value) {
case 'number':
return LongBits.fromNumber(value);
case 'string':
Expand Down
Loading

0 comments on commit a0398f5

Please sign in to comment.