jj
    Preparing search index...

    Function keb2pas

    • Converts a kebab-case string to PascalCase.

      Parameters

      • str: string

        The string to convert.

      Returns string

      The PascalCase string.

      This function splits the string by hyphens and capitalizes the first letter of each segment. It handles multiple hyphens by ignoring empty segments.

      keb2pas('background-color') // 'BackgroundColor'
      keb2pas('my-component') // 'MyComponent'
      keb2pas('multi--dash') // 'MultiDash'

      If str is not a string.