chomens-bot-js/util/containsIllegalCharacters.js

10 lines
332 B
JavaScript
Raw Normal View History

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