misc: updated to use regex literal

This commit is contained in:
Sheen Capadngan
2025-04-22 02:10:56 +08:00
parent c15a1c6ed3
commit ac2ee6884c

View File

@@ -100,7 +100,7 @@ export const isFQDN = (str: string, options: FQDNOptions = {}): boolean => {
const partRegex = new RE2(/^[a-z_\u00a1-\uffff0-9-]+$/i);
const fullWidthRegex = new RE2(/[\uff01-\uff5e]/);
const hyphenRegex = new RE2(/^-|-$/);
const underscoreRegex = new RE2("_");
const underscoreRegex = new RE2(/_/);
return parts.every((part) => {
if (part.length > 63 && !opts.ignore_max_length) {