انتقل إلى المحتوى الرئيسي

Variable: UNRESERVED_LABEL_PATTERN

const UNRESERVED_LABEL_PATTERN: "^(?!..--)" = '^(?!..--)'

Defined in: packages/contracts/src/primitives.ts:111

What keeps a label out of the names DNS reserves: no hyphens in both the third and the fourth position. RFC 5890 sets every such label aside ("reserved LDH labels"), and xn-- is the one in use, the prefix of an internationalised name's encoded form. A slug becomes a host label (<slug>.identity.<domain>), so xn--anything would read to a browser or a certificate authority as a name in another script.

It is a second pattern beside SLUG_PATTERN, not an edit of it, so a failure names this rule and a caller is told about the hyphens instead of being shown the general slug rule their value otherwise meets.