Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/string

Index

Type aliases

ClassNamesArray

ClassNamesArray: (string | StringIndexable | (string | StringIndexable)[])[]

NestedClassNamesArray

NestedClassNamesArray: (string | StringIndexable | ClassNamesArray)[]

Functions

Const classNames

  • Returns a single string of class names to add to HTML elements.

    Implementation and tests adapted from https://www.npmjs.com/package/classnames. This helper was built to replace our reliance on this dependency.

    Parameters

    Returns string

    The concantenated classnames.

Const isString

  • isString(valueToCheck: unknown): valueToCheck is string
  • description

    Checks whether the value provided is of type string

    Parameters

    • valueToCheck: unknown

      The value we are checking is a string

    Returns valueToCheck is string

    Type casting if the value is a string

Const replaceAllInString

  • replaceAllInString(str: string, replacements: Record<string, string>): string

Const stripEscapedWords

  • stripEscapedWords(value: string): string
  • description

    Remove escaped words from a string

    Parameters

    • value: string

      The value to strip escaped words from

    Returns string

    the value without escaped words

Generated using TypeDoc