mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 15:10:13 -05:00
8 lines
358 B
TypeScript
8 lines
358 B
TypeScript
export function ObjectFromEntries<const T extends ReadonlyArray<readonly [PropertyKey, unknown]>>(entries: T): { [K in T[number]as K[0]]: K[1] } {
|
|
return Object.fromEntries(entries) as { [K in T[number]as K[0]]: K[1] }
|
|
}
|
|
|
|
export function ObjectKeys<const T extends Record<string, unknown>>(obj: T): (keyof T)[] {
|
|
return Object.keys(obj) as (keyof T)[]
|
|
}
|