Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils"

Index

Functions

deepClone

  • deepClone(o: object): object
  • Simple object deep clone.

    Parameters

    • o: object

      source object.

    Returns object

fullURL

  • fullURL(path: string, query: object | null | undefined, hash: string): string
  • Get full URL from the base URL, query object, and hash.

    Parameters

    • path: string

      URL base path without query or hash.

    • query: object | null | undefined

      query param dictionary.

    • hash: string

      hash param.

    Returns string

hasPrefix

  • hasPrefix(s: string, prefix: string): boolean
  • String has prefix predicate.

    Parameters

    • s: string

      tested string.

    • prefix: string

      needle.

    Returns boolean

hasSuffix

  • hasSuffix(s: string, suffix: string): boolean
  • String has suffix predicate.

    Parameters

    • s: string

      tested string.

    • suffix: string

      needle.

    Returns boolean

historyFullURL

  • Get full URL from the history location object.

    Parameters

    Returns string

isFloatNumber

  • isFloatNumber(s: string): boolean
  • Is float number predicate

    Parameters

    • s: string

      Tested string.

    Returns boolean

isWholeNumber

  • isWholeNumber(s: string): boolean
  • Is whole number predicate

    Parameters

    • s: string

      Tested string.

    Returns boolean

joinPath

  • joinPath(a: string, b: string): string
  • Join URL paths.

    Parameters

    • a: string

      URL path A.

    • b: string

      URL path B.

    Returns string

parseURL

  • Extract query param and hash from URL and return the base URL, dictionary of query params, and the hash.

    throws

    an error if the URL is not valid.

    Parameters

    • path: string

      full URL.

    Returns ParsedURL

trimPrefix

  • trimPrefix(s: string, prefix: string): string
  • Trim prefix

    Parameters

    • s: string

      tested string.

    • prefix: string

      needle.

    Returns string

urlMatch

  • urlMatch(a: string, b: string): boolean
  • URL match predicate

    throws

    an error if the URL is not valid.

    Parameters

    • a: string

      URL a.

    • b: string

      URL b.

    Returns boolean

urlPrefix

  • urlPrefix(haystack: string, prefix: string): boolean
  • URL prefix predicate

    throws

    an error if the URL is not valid.

    Parameters

    • haystack: string

      URL haystack.

    • prefix: string

      URL prefix.

    Returns boolean

Generated using TypeDoc