@mamodesaebsaad/image-to-base64
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -16,7 +16,4 @@ /** | ||
} | ||
else if (file.type === "gif") { | ||
base64String = base64String.replace("data:image/gif;base64,", ""); | ||
} | ||
else { | ||
base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp);base64,/, ""); | ||
base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp|gif);base64,/, ""); | ||
} | ||
@@ -39,3 +36,2 @@ resolve(base64String); | ||
let svgfileType = "data:image/svg+xml;base64,"; | ||
let gifFileType = "data:image/gif;base64,"; | ||
let image = ""; | ||
@@ -45,5 +41,2 @@ if (file === "svg") { | ||
} | ||
else if (file === "gif") { | ||
image = gifFileType + base64String; | ||
} | ||
else { | ||
@@ -50,0 +43,0 @@ image = imageFiletype + base64String; |
{ | ||
"name": "@mamodesaebsaad/image-to-base64", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Conversion of image to base64 and vice-versa", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -17,7 +17,4 @@ | ||
} | ||
else if (file.type === "gif"){ | ||
base64String = base64String.replace("data:image/gif;base64,", ""); | ||
} | ||
else { | ||
base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp);base64,/, ""); | ||
base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp|gif);base64,/, ""); | ||
} | ||
@@ -42,3 +39,2 @@ resolve(base64String); | ||
let svgfileType = "data:image/svg+xml;base64,"; | ||
let gifFileType = "data:image/gif;base64,"; | ||
let image = ""; | ||
@@ -48,5 +44,2 @@ if(file === "svg"){ | ||
} | ||
else if(file === "gif"){ | ||
image = gifFileType + base64String; | ||
} | ||
else{ | ||
@@ -53,0 +46,0 @@ image = imageFiletype + base64String; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20490
206