Function toEntries

  • Creates an array of [key, value] pairs for the specified dict. The purpose of this function is to allow an override for the type of the object key since TypeScript defaults to only allowing a string (but it could be a string enum).

    Type Parameters

    • V

      Type of value in the specified dict.

    • K = string

      Type of key in the specified dict.

    Parameters

    • dict: Dict<V>

      Object to extrapolate entries from.

    Returns [K, V][]

    Array of [key, value] pairs that adhere to the specified types.

    Use entriesOf instead.