mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
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 🎉
12 lines
265 B
JavaScript
Executable File
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 };
|