• Get or create a value for the specified key

    Type Parameters

    • K

    • V

    • VI extends ((key) => V | Promise<V>)

    Parameters

    • map: Map<K, V>

      Map to get or create the value in

    • key: K

      Key of the value in the map

    • valueInitializer: VI

      Value initializer call when the value is not set

    Returns ReturnType<VI>