Skip to content

Commit

Permalink
Bump 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Aug 30, 2015
1 parent fa34331 commit 84626d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/message-verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var _crypto = require('crypto');

var MessageVerifier = (function () {
function MessageVerifier(secret) {
var options = arguments[1] === undefined ? {} : arguments[1];
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

_classCallCheck(this, MessageVerifier);

Expand Down Expand Up @@ -46,13 +46,13 @@ var MessageVerifier = (function () {
};

MessageVerifier.prototype.encode = function encode(data) {
var encoding = arguments[1] === undefined ? 'ascii' : arguments[1];
var encoding = arguments.length <= 1 || arguments[1] === undefined ? 'ascii' : arguments[1];

return new Buffer(data, encoding).toString('base64');
};

MessageVerifier.prototype.decode = function decode(data) {
var encoding = arguments[1] === undefined ? 'ascii' : arguments[1];
var encoding = arguments.length <= 1 || arguments[1] === undefined ? 'ascii' : arguments[1];

return new Buffer(data, 'base64').toString(encoding);
};
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "message-verifier",
"version": "0.2.0",
"version": "0.2.1",
"description": "Makes it easy to generate and verify messages which are signed to prevent tampering",
"repository": "trekjs/message-verifier",
"author": "fundon cfddream@gmail.com",
Expand All @@ -18,12 +18,9 @@
"test-cov": "babel-node node_modules/.bin/isparta cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/**/*.test.js"
},
"devDependencies": {
"babel": "^5.2.17",
"isparta": "^3.0.3",
"mocha": "^2.2.4"
},
"engines": {
"iojs": "1.x.x"
"babel": "^5.8.23",
"isparta": "^3.0.4",
"mocha": "^2.2.5"
},
"files": [
"LICENSE",
Expand Down

0 comments on commit 84626d0

Please sign in to comment.