Skip to main content

Module domain

Module domain 

Source

Constants§

MAX_SLUG_LEN
MIN_SLUG_LEN

Functions§

derive_and_validate_domain_slug
Convenience: slugify + validate (structural only) in one call. Used by the CLI loader (Pack::open) for local/offline commands like dkp build.
derive_and_validate_domain_slug_for_registry
Convenience: slugify + validate (structural + reserved-word) in one call. Used by the registry publish handler.
slugify_domain
Lowercase, trim, collapse any run of whitespace/punctuation into a single hyphen, strip leading/trailing hyphens. Non-ASCII characters are dropped as separators (ASCII-only slugs).
validate_domain_slug
Validate an already-computed slug: length, charset, hyphenation. This is structural validity only — it does not enforce the registry’s reserved-word denylist, so it’s safe to run for purely local/offline pack builds (e.g. dkp build) where there’s no registry moderation concern. Called independently of slugify_domain (e.g. by backfill scripts re-deriving slugs from stored data).
validate_domain_slug_for_registry
Validate a slug for registry publication: structural validity plus the reserved-word denylist. The registry must validate defensively rather than trust the CLI, so this is what the publish route calls.