node-ejs-renderer/node_modules/@jsonjoy.com/util/lib/strings/util.js
2024-06-09 13:55:01 -04:00

12 lines
576 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPunctuation = exports.isWhitespace = exports.isLetter = void 0;
const LETTER_REGEX = /(\p{Letter}|\d)/u;
const WHITESPACE_REGEX = /\s/;
const isLetter = (char) => LETTER_REGEX.test(char[0]);
exports.isLetter = isLetter;
const isWhitespace = (char) => WHITESPACE_REGEX.test(char[0]);
exports.isWhitespace = isWhitespace;
const isPunctuation = (char) => !(0, exports.isLetter)(char) && !(0, exports.isWhitespace)(char);
exports.isPunctuation = isPunctuation;
//# sourceMappingURL=util.js.map