chore(client/ts): port services/script_context

This commit is contained in:
Elian Doran
2024-12-19 22:16:03 +02:00
parent 650a116193
commit 7c2002c589
3 changed files with 14 additions and 10 deletions

View File

@@ -138,8 +138,8 @@ function formatSize(size: number) {
}
}
function toObject<T>(array: T[], fn: (arg0: T) => [key: string, value: T]) {
const obj: Record<string, T> = {};
function toObject<T, R>(array: T[], fn: (arg0: T) => [key: string, value: R]) {
const obj: Record<string, R> = {};
for (const item of array) {
const [key, value] = fn(item);