I have a function that receives an object as parameter and accesses one of its properties, determined by another parameter. Something like this:
// js code
function setProperty(subject, property, value) {
subject[property] = value;
}
How do I type-annotate this function in a way that makes sure the property param is a key of the subject param, and the value param has the same type?
If it helps, I expect the property param to always be a literal value (a "hard coded" value, not a variable), so that's an acceptable constraint.