Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fix: String not being base64 encoded (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcraven authored and michael-ciniawsky committed Jun 12, 2017
1 parent 020c2a8 commit e9496b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module.exports = function(content) {

// No limits or limit more than content length
if(!limit || content.length < limit) {
if(typeof content === "string") {
content = new Buffer(content);
}
return "module.exports = " + JSON.stringify("data:" + (mimetype ? mimetype + ";" : "") + "base64," + content.toString("base64"));
}

Expand Down

0 comments on commit e9496b9

Please sign in to comment.