frontend: get rid of evil eval function in table sorting; fix typ errors

This commit is contained in:
wea_ondara
2023-11-25 20:50:13 +01:00
parent c21809152d
commit 0307325118

View File

@@ -89,7 +89,7 @@ export default class MangaListTable extends Vue {
if (!this.sortKey) { if (!this.sortKey) {
return this.tableEntries; return this.tableEntries;
} }
const keyExtractor = (e: ViewEntry) => get(e, this.sortKey);//TODO eval is evil const keyExtractor = (e: ViewEntry) => get<any>(e, this.sortKey!);
const comparer = (l: ViewEntry, r: ViewEntry) => { const comparer = (l: ViewEntry, r: ViewEntry) => {
const lkey = keyExtractor(l); const lkey = keyExtractor(l);
const rkey = keyExtractor(r); const rkey = keyExtractor(r);