Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "strings"

Index

Variables

Const asciiWords

asciiWords: RegExp = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g

Const hasUnicodeWord

hasUnicodeWord: RegExp = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/

Const kebabCase

kebabCase: function = curry(caseStr)('-')

Convert string to kebab-case

param

The string to convert

returns

Returns string in kebab-case

Type declaration

    • (v2: T2): R
    • Parameters

      • v2: T2

      Returns R

Const snakeCase

snakeCase: function = curry(caseStr)('_')

Convert string to snake_case

param

The string to convert

returns

Returns string in snake_case

Type declaration

    • (v2: T2): R
    • Parameters

      • v2: T2

      Returns R

Const unicodeWords

unicodeWords: RegExp = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf \t\x0b\f\xa0\n\r]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde])+(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf \t\x0b\f\xa0\n\r]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff])+|[A-Z\xc0-\xd6\xd8-\xde]+|\d+/g

Functions

camelCase

  • camelCase(str: string): string
  • Convert string to camelCase

    Parameters

    • str: string

      The string to convert

    Returns string

    Returns string in camelCase

capitalize

  • capitalize(str: string): string
  • Capitalize first char of string

    Parameters

    • str: string

    Returns string

    Returns string with first char capitalized

caseStr

  • caseStr(casing: string, str: string): string
  • Parameters

    • casing: string
    • str: string

    Returns string

lowerCase

  • lowerCase(s: string): string
  • Convert string to lowerCase

    Parameters

    • s: string

      The string to convert

    Returns string

    Returns string in lowercase

mapWords

  • mapWords(str: string, wordMapFn: function, join?: string): string
  • Parameters

    • str: string
    • wordMapFn: function
        • (word: string, i: number): string | undefined
        • Parameters

          • word: string
          • i: number

          Returns string | undefined

    • Default value join: string = ""

    Returns string

trim

  • trim(str: string): string
  • Removes leading and trailing whitespace or specified characters from string.

    Parameters

    • str: string

      The string to trim.

    Returns string

    Trimmed string

wildcardToRegExp

  • wildcardToRegExp(wildcardPattern: string, flags?: undefined | string): RegExp
  • Convert wildcard string to RegExp. Like hel*o becames /hel.*o/

    Parameters

    • wildcardPattern: string

      pattern to convert

    • Optional flags: undefined | string

      flags for created regex 'igm'

    Returns RegExp

    Constructed regexp

words

  • words(str?: string | null): string[]
  • Spit string into words

    Parameters

    • Optional str: string | null

      The string to split

    Returns string[]

    Matched words

Generated using TypeDoc