nyx Typedoc
    Preparing search index...

    Function ensureKey

    • Type safely sets a value if it's undefined or non present, useful for filling partials.

      Type Parameters

      • K extends string | number | symbol
      • I extends object
      • V

      Parameters

      • input: I
      • key: K
      • valueIfNotPresent: Exclude<V, undefined>

      Returns asserts input is I & Record<K, V>