🎨 Code refactor

This commit is contained in:
KaizIqbal 2020-07-25 18:33:46 +05:30
parent 57c424e668
commit 0771cf6777

View file

@ -1,19 +1,21 @@
import fs from "fs";
import { generateRenderTemplate } from "./helpers/htmlTemplate";
import { svgs } from "./config";
import { staticSvgs } from "./config";
(async () => {
// iterate over all .svg files
svgs.forEach((svg) => {
// reading file
const generateStaticSvgBitmaps = (svg: string) => {
fs.readFile(svg, "utf8", (error, data) => {
if (error) {
return console.log(error);
}
// Generating HTML Template
generateRenderTemplate(data);
});
};
(async () => {
// iterate over all .svg files
staticSvgs.forEach((svg) => {
generateStaticSvgBitmaps(svg);
});
})();