Vinyl
    Preparing search index...

    Function toKebabCase

    • Converts a string to kebab-case.

      This function transforms camelCase, PascalCase, snake_case, and space-separated strings into a normalized kebab-case format. It removes non-alphanumeric characters (excluding hyphens), collapses multiple delimiters, and trims leading/trailing hyphens.

      Parameters

      • str: string

        The input string to convert.

      Returns string

      The kebab-case version of the input.

      toKebabCase("HelloWorld")         // "hello-world"
      toKebabCase("hello_world test") // "hello-world-test"
      toKebabCase("SomeText123") // "some-text123"