10
0

util.js 576 B

123456789101112
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.isPunctuation = exports.isWhitespace = exports.isLetter = void 0;
  4. const LETTER_REGEX = /(\p{Letter}|\d)/u;
  5. const WHITESPACE_REGEX = /\s/;
  6. const isLetter = (char) => LETTER_REGEX.test(char[0]);
  7. exports.isLetter = isLetter;
  8. const isWhitespace = (char) => WHITESPACE_REGEX.test(char[0]);
  9. exports.isWhitespace = isWhitespace;
  10. const isPunctuation = (char) => !(0, exports.isLetter)(char) && !(0, exports.isWhitespace)(char);
  11. exports.isPunctuation = isPunctuation;
  12. //# sourceMappingURL=util.js.map