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

Commit e9496b9

Browse files
tomcravenmichael-ciniawsky
authored andcommitted
fix: String not being base64 encoded (#67)
1 parent 020c2a8 commit e9496b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ module.exports = function(content) {
2020

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

0 commit comments

Comments
 (0)