Files
fredy/lib/utils.js
Christian Kellner 770d30af95 Concurrent-Jobs (#7)
Fredy 2.0.0 introduces the concept of search jobs. You can now configure multiple of these jobs running in the same instance of Fredy. Also a new API has been created 🎉
2020-02-26 09:05:20 +01:00

12 lines
265 B
JavaScript
Executable File

function isOneOf(word, arr) {
if (arr == null || arr.length === 0) {
return false;
}
const expression = String.raw`\b(${arr.join('|')})\b`;
const blacklist = new RegExp(expression, 'ig');
return blacklist.test(word);
}
module.exports = { isOneOf };