Variable utilsConst

utils: {
    generateChallenge: (() => string);
    unwrap: (<T>(result, errMessage?) => T);
} = ...

Type declaration

  • generateChallenge: (() => string)
      • (): string
      • Generates a challenge string using the window.crypto API.

        Returns string

        A URL-safe base64 encoded string representing the challenge.

  • unwrap: (<T>(result, errMessage?) => T)
      • <T>(result, errMessage?): T
      • A utility function to get the value from a Result or throw if there was an error

        Type Parameters

        • T = unknown

          the expected value of an ok result

        Parameters

        • result: Result<T, unknown>

          The Result to unwrap

        • Optional errMessage: string

          Error message used when unwrap failed

        Returns T

        Remarks

        Allows you to get the value of a result directly or handle an error Result as an exception

Generated using TypeDoc