Skip to content

Commit

Permalink
isBase64 now returns boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
tinybike committed Apr 7, 2017
1 parent 043e7e8 commit 42537d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function isBase64(s) {
if (s.length % 4 > 0 || s.match(/[^0-9a-z+\/=]/i)) return false;

index = s.indexOf("=");
return index === -1 || s.slice(index).match(/={1,2}/);
if (index === -1 || s.slice(index).match(/={1,2}/)) return true;
return false;
}

module.exports = {
Expand Down

0 comments on commit 42537d8

Please sign in to comment.