I have a variable initialized with properties like this:
const decoded = JSON.parse(nk.binaryToString(message.data));
const matchStateChanges = {
humans: {},
ball: {},
}
const { name } = decoded // for example, a string like "Player1"
matchStateChanges.humans[name] = state.humans[name] // an object type like {pos: {12,13}}
However, the compiler is throwing this error:
$ npx tsc
match_control.ts:145:7 - error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'. 145 matchStateChanges.humans[name] = state.humans[name] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What am I missing here?