Class FormatHelpers

Constructors

Properties

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

Transform into upper case string with an underscore between words.

Type declaration

    • (input, options?): string
    • Parameters

      • input: string
      • Optional options: Options

      Returns string

Returns

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

Transform into a lower cased string with dashes between words.

Type declaration

    • (input, options?): string
    • Parameters

      • input: string
      • Optional options: Options

      Returns string

Returns

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

Transform into a string of capitalized words without separators.

Type declaration

    • (input, options?): string
    • Parameters

      • input: string
      • Optional options: Options

      Returns string

Returns

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

Transform into lower case string with an underscore between words.

Type declaration

    • (input, options?): string
    • Parameters

      • input: string
      • Optional options: Options

      Returns string

Returns

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 indentation string based on how many and which type of indentation are requested.

    Parameters

    • size: number = 0

      the number of indentations to use

    • type: IndentationTypes = IndentationTypes.SPACES

      the type of indentations 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 indentations to use. 1 by default

    • type: IndentationTypes = IndentationTypes.SPACES

      the type of indentations to use. SPACES by default.

    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 with the separator denoted by the next word capitalized.

    Parameters

    • renderName: string

    Returns string

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

    Parameters

    • value: string

      to transform

    Returns string