This commit is contained in:
Nathan Bierema 2023-04-15 11:33:57 -04:00
parent 6b1d60da7d
commit 1c8658b8c7

View File

@ -6,10 +6,10 @@ function iterateToKey(obj: any, key: string | number) {
let idx = 0; let idx = 0;
for (const entry of obj) { for (const entry of obj) {
if (Array.isArray(entry)) { if (Array.isArray(entry)) {
if (entry[0] === key) return entry[1]; if (entry[0] === (key as string)) return entry[1];
} else { } else {
if (idx > key) return; if (idx > (key as number)) return;
if (idx === key) return entry; if (idx === (key as number)) return entry;
} }
idx++; idx++;
} }