TOC Toolkit API - v0.1.0
    Preparing search index...

    Function getOrInsert

    • Returns the value of a key. A missing key first gets make(), so the map holds the value that the call returns and make runs at most once per key. A value is never undefined, because a stored undefined would read as a missing key.

      Type Parameters

      • K
      • V extends {}

      Parameters

      • map: Map<K, V>
      • key: K
      • make: () => V

      Returns V