Function assertDictionary

  • Narrows an unknown value to a Dictionary<T> if it is type-compatible and tests positively with isDictionary, or raises an error otherwise.

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

    • Optionalmessage: string

      The error message to use if value is not type-compatible.

    Returns asserts value is Dictionary<T>

    AssertionFailedError If the value was undefined.