plainfp - v0.1.0
    Preparing search index...

    Function get

    • Look up a key's value. Only own properties are considered — inherited prototype-chain entries return none.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • V

      Parameters

      • record: Readonly<Record<PropertyKey, V>>
      • key: PropertyKey

      Returns OptionType<V>

      const cache: Record<string, number> = { hits: 42 }
      get(cache, "hits") // { some: true, value: 42 }
      get(cache, "toString") // { some: false } — prototype method ignored
    • Look up a key's value. Only own properties are considered — inherited prototype-chain entries return none.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • V

      Parameters

      • key: PropertyKey

      Returns (record: Readonly<Record<PropertyKey, V>>) => OptionType<V>

      const cache: Record<string, number> = { hits: 42 }
      get(cache, "hits") // { some: true, value: 42 }
      get(cache, "toString") // { some: false } — prototype method ignored