Class FormatHelpers

Hierarchy

  • FormatHelpers

Constructors

Properties

toCamelCase: ((input, options?) => string) = camelCase

Type declaration

    • (input, options?): string
    • Transform into a string with the separator denoted by the next word capitalized.

      Parameters

      • input: string
      • Optional options: Options

      Returns string

toConstantCase: ((input, options?) => string) = constantCase

Type declaration

    • (input, options?): string
    • Transform into upper case string with an underscore between words.

      Parameters

      • input: string
      • Optional options: Options

      Returns string

toParamCase: ((input, options?) => string) = paramCase

Type declaration

    • (input, options?): string
    • Transform into a lower cased string with dashes between words.

      Parameters

      • input: string
      • Optional options: Options

      Returns string

toPascalCase: ((input, options?) => string) = pascalCase

Type declaration

    • (input, options?): string
    • Transform into a string of capitalized words without separators.

      Parameters

      • input: string
      • Optional options: Options

      Returns string

toSnakeCase: ((input, options?) => string) = snakeCase

Type declaration

    • (input, options?): string
    • Transform into lower case string with an underscore between words.

      Parameters

      • input: string
      • Optional options: Options

      Returns string

Methods

  • Ensures breaking text into new lines according to newline char (\n) in text.

    Parameters

    • lines: string | string[]

      to breaks

    Returns string[]

  • Private

    Get the indendation string based on how many and which type of indentation are requested.

    Parameters

    • size: number = 0

      the number of indendations to use

    • type: IndentationTypes = IndentationTypes.SPACES

      the type of indendations to use. SPACES by default.

    Returns string

  • Ensures indentations are prepended to content.

    Parameters

    • content: string = ''

      to prepend the indentation.

    • size: number = 1

      the number of indendations to use. 1 by default

    • type: IndentationTypes = IndentationTypes.SPACES

      the type of indendations to use. SPACES by default.

    Returns string

  • Lower first char in given string value.

    Parameters

    • value: string

      to change

    Returns string

  • Render given JSON Schema example to string

    Parameters

    • examples: any[]

      to render

    Returns string

  • Replace special characters (Not 0-9,a-z,A-Z) with character names

    Parameters

    • string: string
    • Optional options: ReplaceSpecialCharactersOptions

    Returns string

  • Transform into a string of capitalized words without separators merging numbers.

    Parameters

    • value: string

      to transform

    Returns string

  • Upper first char in given string value.

    Parameters

    • value: string

      to change

    Returns string

Generated using TypeDoc