Skip to content

Commit 90c9112

Browse files
committed
Fix build error
1 parent f7e0ff1 commit 90c9112

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/lib/utils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ export function cn(...inputs: ClassValue[]) {
55
return twMerge(clsx(inputs))
66
}
77

8-
export function arrayToObjectEntries(array: string[]) {
9-
const obj: Record<string, Record<never, never>> = {}
10-
for (const key in array) {
11-
obj[key] = {}
8+
export function arrayToObjectEntries(array: (string | { field: string })[]) {
9+
const obj: Record<string, Record<string, unknown>> = {}
10+
for (const key of array) {
11+
if (typeof key === "string") {
12+
obj[key] = {}
13+
} else {
14+
obj[key.field] = key
15+
}
1216
}
1317
return obj
1418
}

0 commit comments

Comments
 (0)