From 639159d4b344834a43945df6bfe502ffeebb1d80 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Wed, 8 Sep 2021 12:03:55 +0100 Subject: [PATCH] Swap replaceAll for regex Was using replaceAll, which isn't available in Node.JS. Instead using regex now --- functions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/index.js b/functions/index.js index 57071d3..f990da2 100644 --- a/functions/index.js +++ b/functions/index.js @@ -354,7 +354,7 @@ function cleanseVocabString(item) { let newString = item; chars.split("").forEach((char) => { - newString = newString.replaceAll(char, ""); + newString = newString.replace(new RegExp(char, 'g'), ""); }); return newString;