Options
All
  • Public
  • Public/Protected
  • All
Menu

Package strings

@typed/strings

Composable string functions

Index

Variables

Const plural

plural: { (str: string, numOfItems: number): string; (str: string): (numOfItems: number) => string } = curry(__plural) as {(str: string, numOfItems: number): string(str: string): (numOfItems: number) => string}

Append 's' to a value if numOfItems != 1

param

:: string

param

:: number

returns

:: string

Type declaration

    • (str: string, numOfItems: number): string
    • (str: string): (numOfItems: number) => string
    • Parameters

      • str: string
      • numOfItems: number

      Returns string

    • Parameters

      • str: string

      Returns (numOfItems: number) => string

        • (numOfItems: number): string
        • Parameters

          • numOfItems: number

          Returns string

Const repeat

repeat: Curry2<number, string, string> = curry((n: number, str: string) =>str.repeat(n),)

Const split

split: { (separator: string | RegExp, str: string): string[]; (separator: string | RegExp): (str: string) => string[] } = curry(__split)

Split a string

Type declaration

    • (separator: string | RegExp, str: string): string[]
    • (separator: string | RegExp): (str: string) => string[]
    • Parameters

      • separator: string | RegExp
      • str: string

      Returns string[]

    • Parameters

      • separator: string | RegExp

      Returns (str: string) => string[]

        • (str: string): string[]
        • Parameters

          • str: string

          Returns string[]

Const substr

substr: { (from: number, length: number | undefined, str: string): string; (from: number, length: number | undefined): (str: string) => string } = curry(__substr)

Get the substring of a string

Type declaration

    • (from: number, length: number | undefined, str: string): string
    • (from: number, length: number | undefined): (str: string) => string
    • Parameters

      • from: number
      • length: number | undefined
      • str: string

      Returns string

    • Parameters

      • from: number
      • length: number | undefined

      Returns (str: string) => string

        • (str: string): string
        • Parameters

          • str: string

          Returns string

Const substring

substring: { (from: number, to: number | undefined, str: string): string; (from: number, to: number | undefined): (str: string) => string } = curry(__substring)

Get the substring of a string

Type declaration

    • (from: number, to: number | undefined, str: string): string
    • (from: number, to: number | undefined): (str: string) => string
    • Parameters

      • from: number
      • to: number | undefined
      • str: string

      Returns string

    • Parameters

      • from: number
      • to: number | undefined

      Returns (str: string) => string

        • (str: string): string
        • Parameters

          • str: string

          Returns string

Functions

capitalize

  • capitalize(str: string): string

Const toLowerCase

  • toLowerCase(str: string): string

Const toUpperCase

  • toUpperCase(str: string): string

Const trim

  • trim(str: string): string

Const trimLeft

  • trimLeft(str: string): string

Const trimRight

  • trimRight(str: string): string

Generated using TypeDoc