schema-components - v3.7.0
    Preparing search index...

    Function sanitisePrefix

    • Normalise a framework useId()-style value into a DOM-id-safe prefix. Framework useId implementations often return values containing : or other characters that are invalid in CSS selectors. This function replaces any run of non-alphanumeric characters with a single hyphen and trims leading/trailing hyphens.

      Throws when the sanitised result is empty so callers receive an actionable error rather than a silent empty-string id.

      Parameters

      • value: string

      Returns string