I am doing the following object access. But TS complains that it may be undefined even when I check for it.
if (metrics[key0]) { if (metrics[key0][k