utf-8 --> utf8

This commit is contained in:
RMidhunSuresh 2022-03-25 14:11:09 +05:30
parent 5d5eb93baa
commit 8c6400ab2c

View File

@ -23,7 +23,7 @@ const path = require("path");
* @param {string} secondaryColor Secondary color for the new svg * @param {string} secondaryColor Secondary color for the new svg
*/ */
module.exports.buildColorizedSVG = function (svgLocation, primaryColor, secondaryColor) { module.exports.buildColorizedSVG = function (svgLocation, primaryColor, secondaryColor) {
const svgCode = fs.readFileSync(svgLocation, { encoding: "utf-8"}); const svgCode = fs.readFileSync(svgLocation, { encoding: "utf8"});
let coloredSVGCode = svgCode.replaceAll("#ff00ff", primaryColor); let coloredSVGCode = svgCode.replaceAll("#ff00ff", primaryColor);
coloredSVGCode = coloredSVGCode.replaceAll("#00ffff", secondaryColor); coloredSVGCode = coloredSVGCode.replaceAll("#00ffff", secondaryColor);
const fileName = svgLocation.match(/.+\/(.+\.svg)/)[1]; const fileName = svgLocation.match(/.+\/(.+\.svg)/)[1];