Class Utils

Utility functions for the Iaptic library

Hierarchy

  • Utils

Constructors

Methods

  • Base64 encode a string

    Parameters

    • str: string

      String to encode

    Returns string

  • Build URL with query parameters

    Parameters

    • baseUrl: string

      Base URL

    • params: Record<string, string>

      Query parameters

    Returns string

  • Format a ISO 8601 period in English

    Parameters

    • period: string

      ISO 8601 period

    Returns string

  • Format a price amount from micros

    Parameters

    • amountMicros: number
    • currency: string

    Returns string

  • Get item from localStorage with type safety

    Type Parameters

    • T

    Parameters

    • key: string

      Storage key

    Returns null | T

  • Get item from localStorage as string

    Parameters

    • key: string

      Storage key

    Returns null | string

  • Remove item from storage

    Parameters

    • key: string

      Storage key

    Returns boolean

  • Set item in localStorage

    Parameters

    • key: string

      Storage key

    • value: any

      Value to store

    Returns boolean

  • Parameters

    • key: string
    • value: string

    Returns boolean

Generated using TypeDoc