Function getKey

  • Higher order function to get a key from an object

    Returns

    function that retrieves the key from an object

    Example

    getKey('name')({ name: 'John' }) === 'John'
    

    Type Parameters

    • TObj

    Parameters

    • key: keyof TObj

      the key to retrieve

    Returns ((obj) => TObj[keyof TObj])

      • (obj): TObj[keyof TObj]
      • Parameters

        • obj: TObj

        Returns TObj[keyof TObj]

Generated using TypeDoc