Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "case"

Index

Functions

Const camel

  • camel(x: string, delim?: any): string
  • Converts a kebab-case or snake_case string into CamelCase. Uses - as default delimiter.

    Parameters

    • x: string
    • Default value delim: any = "-"

    Returns string

Const capitalize

  • capitalize(x: string): string
  • String formatter which capitalizes first character.

    Parameters

    • x: string

      string to transform

    Returns string

Const kebab

  • kebab(x: string, delim?: any): string
  • Converts a CamelCase string into kebab case, with optional custom delimiter (- by default).

    TODO: Switch back to currently broken Regex w/ positive lookbehind, once avail in FF & Safari (currently TC39 stage 4)

    https://github.com/tc39/proposal-regexp-lookbehind

    kebab("FooBar23Baz");
    // "foo-bar23-baz"

    Parameters

    • x: string
    • Default value delim: any = "-"

    Returns string

Const lower

  • lower(x: string): string
  • Lowercase string formatter.

    Parameters

    • x: string

      string to transform

    Returns string

Const snake

  • snake(x: string): string
  • Short for kebab using _ as delimiter.

    Parameters

    • x: string

    Returns string

Const upper

  • upper(x: string): string
  • Uppercase string formatter.

    Parameters

    • x: string

      string to transform

    Returns string

Generated using TypeDoc