Skip to content

Commit

Permalink
add replaceAll polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Jan 8, 2022
1 parent 0d4747e commit 3294b27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/missing-colors.js
Expand Up @@ -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();
Expand Down

0 comments on commit 3294b27

Please sign in to comment.