chomens-bot-js/util/containsIllegalCharacters.js
2022-11-07 20:08:29 +07:00

9 lines
336 B
JavaScript

/* eslint-disable max-len */
function isAllowedCharacter(character) {
return character !== '\xa7' && character >= ' ' && character !== '\x7f';
}
function containsIllegalCharacters(string) {
for (let i = 0; i < string.length; i++) if (!isAllowedCharacter(string[i])) return true;
}
module.exports = {containsIllegalCharacters};