slugify | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function slugify

    • Generate a slug from a (suggested) (file)name

      Parameters

      • text: string

        Text to convert

      • options: { keep?: string; separator?: string } = {}

        Options for slugification

        • Optionalkeep?: string

          Set of characters to keep in addition to a-z0-9

        • Optionalseparator?: string

          Separator to use between words (defaults to '-')

      Returns null | string

      Slugified text or null if we couldn't generate anything reeadable