Trying to access a record with brackets
export interface RecordValue {
value: string
}
export const TestRecords: Record<string, RecordValue> = {
Test0: { value: 'TestValue0' },
Test1: { value: 'TestValue1' },
Test2: { value: 'TestValue2' },
}
const foo = (string: string): void => {
// eslint-disable-next-line no-unused-expressions
TestRecords[string].value
}
How to I do this without disabling eslint-disable-next-line no-unused-expressions