Function getOrInsert

  • Retrieve or insert value in a Map-like container.

    Type Parameters

    Parameters

    • ct: C

      Map-like container.

    • key: Parameters<C["get"]>[0] & Parameters<C["set"]>[0]

      Map key.

    • make: () => Parameters<C["set"]>[1]

      Function to create the value if needed.

    Returns Parameters<C["set"]>[1]

    Existing or newly created value.