mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
9 lines
202 B
JavaScript
Executable File
9 lines
202 B
JavaScript
Executable File
function isOneOf (word, arr) {
|
|
const expression = String.raw`\b(${arr.join('|')})\b`;
|
|
const blacklist = new RegExp(expression, 'ig');
|
|
|
|
return blacklist.test(word)
|
|
}
|
|
|
|
module.exports = { isOneOf };
|