fix: error with typescript 4.8

Massimo Melina committed Aug 27, 2022 at 19:19 UTC 6d6fb67793a1a6825f6c008a5af2efc154d2185b
2 files changed +2 -2
admin/src/misc.ts
+1 -1
@@ -89,7 +89,7 @@ export async function manipulateConfig(k: string, work:(data:any) => any) {
89 await apiCall('set_config', { values: { [k]: will } })
90 }
91
92 -export function typedKeys<T>(o: T) {
92 +export function typedKeys<T extends {}>(o: T) {
93 return Object.keys(o) as (keyof T)[]
94 }
95
src/misc.ts
+1 -1
@@ -121,7 +121,7 @@ export function objRenameKey(o: Dict | undefined, from: string, to: string) {
121 return true
122 }
123
124 -export function typedKeys<T>(o: T) {
124 +export function typedKeys<T extends {}>(o: T) {
125 return Object.keys(o) as (keyof T)[]
126 }
127