1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-06-18 07:27:49 +02:00

add replaceAll polyfill

This commit is contained in:
Harvey Tindall 2022-01-08 00:22:21 +00:00
parent 0d4747e8e9
commit 3294b27029
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -13,6 +13,11 @@ const hasDark = (item) => {
return false;
};
if (typeof String.prototype.replaceAll === "undefined") {
String.prototype.replaceAll = function(match, replace) {
return this.replace(new RegExp(match, 'g'), () => replace);
}
}
function fixHTML(infile, outfile) {
let f = fs.readFileSync(infile).toString();