Variable StringHelpersConst

StringHelpers: {
    camelCaseToSnakeCase: ((text) => string);
    camelize: ((value) => string);
    capitalize: ((string) => string);
    capitalizeEachWord: ((string) => string);
    equals: ((value1, value2?) => boolean);
    extractEmailDomain: ((email) => undefined | string);
    humanize: ((value) => string);
    isAlpha: ((value) => boolean);
    isBlank: ((value?) => boolean);
    isEmpty: ((value) => boolean);
    isNumeric: ((value) => boolean);
    isString: (<T>(data) => data is string);
    kebabCaseToCamelCase: ((text) => string);
    pad: ((value, nbOfCharacters, paddingCharacter?) => string);
    plainify: ((value) => string);
    snakeCaseToCamelCase: ((text) => string);
    valueOrEmpty: ((value?) => string);
} = ...

Type declaration

  • camelCaseToSnakeCase: ((text) => string)

    Converts the given camel case formatted string into a snake case format.

    Param: text

    The string to convert.

    Returns

    the converted string result.

      • (text): string
      • Converts the given camel case formatted string into a snake case format.

        Parameters

        • text: string

          The string to convert.

        Returns string

        the converted string result.

  • camelize: ((value) => string)

    Camelize the given string.

    Param: value

    the string to camelize.

    Returns

    the formatted result.

      • (value): string
      • Camelize the given string.

        Parameters

        • value: string

          the string to camelize.

        Returns string

        the formatted result.

  • capitalize: ((string) => string)

    Capitalizes the first letter of the given string.

    Param: string

    the string to compute.

    Returns

    the result string.

      • (string): string
      • Capitalizes the first letter of the given string.

        Parameters

        • string: string

          the string to compute.

        Returns string

        the result string.

  • capitalizeEachWord: ((string) => string)

    Capitalizes the first letter of each word of the given string.

    Param: string

    the string to compute.

    Returns

    the result string.

      • (string): string
      • Capitalizes the first letter of each word of the given string.

        Parameters

        • string: string

          the string to compute.

        Returns string

        the result string.

  • equals: ((value1, value2?) => boolean)

    Test whether the two given string trimed value are equal.

    Param: value1

    The first value to compare.

    Param: value2

    The second value to compare.

    Returns

    true if the two values are equal once trimed, false otherwise.

      • (value1, value2?): boolean
      • Test whether the two given string trimed value are equal.

        Parameters

        • value1: string

          The first value to compare.

        • Optional value2: string

          The second value to compare.

        Returns boolean

        true if the two values are equal once trimed, false otherwise.

  • extractEmailDomain: ((email) => undefined | string)

    Extract the domain name from the given email address.

    Param: email

    The email address.

    Returns

    the corresponding domain name.

      • (email): undefined | string
      • Extract the domain name from the given email address.

        Parameters

        • email: string

          The email address.

        Returns undefined | string

        the corresponding domain name.

  • humanize: ((value) => string)

    Humanize the given string.

    Param: value

    the string to humanize.

    Returns

    the formatted result.

      • (value): string
      • Humanize the given string.

        Parameters

        • value: string

          the string to humanize.

        Returns string

        the formatted result.

  • isAlpha: ((value) => boolean)

    Tests whether the given string contains only alpha characters.

    Param: value

    The string to check.

    Returns

    true if the given string only contains alpha characters, false otherwise.

      • (value): boolean
      • Tests whether the given string contains only alpha characters.

        Parameters

        • value: string

          The string to check.

        Returns boolean

        true if the given string only contains alpha characters, false otherwise.

  • isBlank: ((value?) => boolean)

    Test whether the given string is either undefined, null or equal to an empty string.

    Param: value

    The string to test.

    Returns

    true if the given string is blank, false otherwise.

      • (value?): boolean
      • Test whether the given string is either undefined, null or equal to an empty string.

        Parameters

        • Optional value: null | string

          The string to test.

        Returns boolean

        true if the given string is blank, false otherwise.

  • isEmpty: ((value) => boolean)

    Test whether the given string is strictly equal to an empty string.

    Param: value

    The string to test.

    Returns

    true if the given string is empty, false otherwise.

      • (value): boolean
      • Test whether the given string is strictly equal to an empty string.

        Parameters

        • value: string

          The string to test.

        Returns boolean

        true if the given string is empty, false otherwise.

  • isNumeric: ((value) => boolean)

    Tests whether the given string contains only numeric characters.

    Param: value

    The string to check.

    Returns

    true if the given string only contains numeric characters, false otherwise.

      • (value): boolean
      • Tests whether the given string contains only numeric characters.

        Parameters

        • value: string

          The string to check.

        Returns boolean

        true if the given string only contains numeric characters, false otherwise.

  • isString: (<T>(data) => data is string)

    Tests whether the given data parameter is a string.

    Param: data

    The data to test.

    Returns

    true if the given data is a string, false otherwise.

      • <T>(data): data is string
      • Tests whether the given data parameter is a string.

        Type Parameters

        • T

        Parameters

        • data: string | T

          The data to test.

        Returns data is string

        true if the given data is a string, false otherwise.

  • kebabCaseToCamelCase: ((text) => string)

    Converts the given kebab case formatted string into a camel case format.

    Param: text

    The string to convert.

    Returns

    the converted string result.

      • (text): string
      • Converts the given kebab case formatted string into a camel case format.

        Parameters

        • text: string

          The string to convert.

        Returns string

        the converted string result.

  • pad: ((value, nbOfCharacters, paddingCharacter?) => string)

    Formats the given string value to contain at least the given number of characters, adding the given padding character at the end of the value if needed.

    Param: value

    the value to format.

    Param: nbOfCharacters

    The desired minimum number of characters.

    Param: paddingCharacter

    The padding character.

    Returns

    the formatted result.

      • (value, nbOfCharacters, paddingCharacter?): string
      • Formats the given string value to contain at least the given number of characters, adding the given padding character at the end of the value if needed.

        Parameters

        • value: string

          the value to format.

        • nbOfCharacters: number

          The desired minimum number of characters.

        • paddingCharacter: string = EMPTY

          The padding character.

        Returns string

        the formatted result.

  • plainify: ((value) => string)

    Plainify the given string, converting every special character into its plain brother.

    Param: value

    The string to convert.

    Returns

    a plainified string.

      • (value): string
      • Plainify the given string, converting every special character into its plain brother.

        Parameters

        • value: string

          The string to convert.

        Returns string

        a plainified string.

  • snakeCaseToCamelCase: ((text) => string)

    Converts the given snake case formatted string into a camel case format.

    Param: text

    The string to convert.

    Returns

    the converted string result.

      • (text): string
      • Converts the given snake case formatted string into a camel case format.

        Parameters

        • text: string

          The string to convert.

        Returns string

        the converted string result.

  • valueOrEmpty: ((value?) => string)

    Converted any given blank values to an empty string (""). If the given value contains a string, the method will return it unarmed.

    Param: value

    The value to convert.

    Returns

    the exact given string if not blank, an empty string otherwise.

      • (value?): string
      • Converted any given blank values to an empty string (""). If the given value contains a string, the method will return it unarmed.

        Parameters

        • Optional value: string | false

          The value to convert.

        Returns string

        the exact given string if not blank, an empty string otherwise.

Generated using TypeDoc