79219549

Date: 2024-11-24 07:22:54
Score: 2.5
Natty:
Report link

Title: Type created with keyof cannot be used to index the type it was created from

Body: I’m trying to write a utility function in TypeScript to access properties inside an object. Specifically, I want the function to: 1. Take an object (of a known structure) as the first argument. 2. Take the name of a property within data (from the object’s type) as the second argument. 3. Return the value of that property, with TypeScript correctly inferring the type of the returned value.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • No code block (0.5):
  • Low reputation (1):
Posted by: Saidali Saidali.n