Function kebabCase

  • Converts a string to kebab-case

    Parameters

    • str: string

      string to convert

    • options: {
          screaming: boolean;
      } = ...

      options for the conversion

      • screaming: boolean

    Returns string

    the string in kebab-case

    Example

    kebabCase('fooBar') // returns 'foo-bar'
    kebabCase('foo_bar') // returns 'foo-bar'
    kebabCase('foo-bar') // returns 'foo-bar'
    kebabCase('FOO_BAR') // returns 'foo-bar'
    kebabCase('foo') // returns 'foo'
    kebabCase('') // returns ''
    kebabCase('fooBar', { screaming: true }) // returns 'FOO-BAR'
    kebabCase('foo_bar', { screaming: true }) // returns 'FOO-BAR'
    kebabCase('foo-bar', { screaming: true }) // returns 'FOO-BAR'
    kebabCase('FOO_BAR', { screaming: true }) // returns 'FOO-BAR'
    kebabCase('foo', { screaming: true }) // returns 'FOO'

Generated using TypeDoc