UNPKG

typia

Version:

Superfast runtime validators with only one line

6 lines (4 loc) 253 B
const _isFormatHostname = (str) => PATTERN.test(str); const PATTERN = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i; export { _isFormatHostname }; //# sourceMappingURL=_isFormatHostname.mjs.map