How do I get this key to be a string when it also has to be a keyof T?
function hello <T extends {[key: string]: string}> (object: T, key: keyof T) {
hasToBeString(key)
// ^?
}
const hasToBeString = (v: string) => {
return v
}
How do I get this key to be a string when it also has to be a keyof T?
function hello <T extends {[key: string]: string}> (object: T, key: keyof T) {
hasToBeString(key)
// ^?
}
const hasToBeString = (v: string) => {
return v
}
