Permalink
Browse files

Fix to generation of verify methods for bytes

It’s just missing a bracket.
  • Loading branch information...
jonathon-love committed Dec 11, 2016
1 parent 178525c commit 3e9d8ea9a5cbb2e029b5c892714edd6926d2e5a7
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/verify.js
@@ -129,7 +129,7 @@ function verify(message) {
// required or present fields
} else if (field.required || value !== undefined) {
if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign
return reason;
}
@@ -172,7 +172,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
("return%j", invalid(field, "string"));
break;
case "bytes": gen
("if(!(%s&&typeof %s.length==='number'||util.isString(%s))", ref, ref, ref)
("if(!(%s&&typeof %s.length==='number'||util.isString(%s)))", ref, ref, ref)
("return%j", invalid(field, "buffer"));
break;
default:

0 comments on commit 3e9d8ea

Please sign in to comment.