Skip to content

Commit eff1d43

Browse files
committed
Fix TypeScript error in store.ts - replace find() with for loop for ES5 compatibility
1 parent 4eddc7b commit eff1d43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

console/atest-ui/src/views/store.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ const Cassandra = "cassandra";
6363
export const GetDriverName = (store: Store): string => {
6464
switch (store.kind.name) {
6565
case 'atest-store-orm':
66-
return store.properties.find((p: Pair) => p.key === 'driver')?.value || MySQL;
66+
const properties = store.properties as Pair[];
67+
for (let i = 0; i < properties.length; i++) {
68+
if (properties[i].key === 'driver') {
69+
return properties[i].value || MySQL;
70+
}
71+
}
72+
return MySQL;
6773
case 'atest-store-cassandra':
6874
return Cassandra;
6975
}

0 commit comments

Comments
 (0)