diff --git a/src/utils/array.js b/src/utils/array.js new file mode 100644 index 0000000..80fab5b --- /dev/null +++ b/src/utils/array.js @@ -0,0 +1,7 @@ +const existsInArray = (input = '', listOfWords = []) => { + return listOfWords.some(keyword => String(input).toLowerCase().includes(keyword.toLowerCase())); +}; + +export { + existsInArray, +}; diff --git a/src/utils/strings.js b/src/utils/strings.js index 2bbeaa9..28c464a 100644 --- a/src/utils/strings.js +++ b/src/utils/strings.js @@ -19,7 +19,7 @@ const decodeHTMLEntities = function(text) { return text; }; -const cleanNames = function (text) { +const cleanNames = function(text) { return decodeHTMLEntities(text) .replace(/( עם |feat\.|Ft\.|Featuring|)/g, '') .replace(/(&|,)/g, '')