Replace testing code with production

This commit is contained in:
2021-09-08 12:22:25 +01:00
parent 014bbbdd4f
commit 97dfe5955f

View File

@@ -349,21 +349,9 @@ function arraysHaveSameMembers(arr1, arr2) {
* @return {string} The original string with the unwanted characters removed.
*/
function cleanseVocabString(item) {
const chars = " .,()-_'\"";
let newString = item;
chars.split("").forEach((char) => {
newString = newString.replace(new RegExp(char, 'g'), "");
});
return newString;
}
exports.cleanseVocabString = functions.https.onCall((data, context) => {
const chars = /[ °"§%()\[\]{}=\\?´`'#<>|,;.:+_-]+/g;
return data.replace(chars, "");
})
}
/**
* Processes a response to a question in a vocab set.