mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
update
This commit is contained in:
7
web/utils/object.ts
Normal file
7
web/utils/object.ts
Normal file
@ -0,0 +1,7 @@
|
||||
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)[]
|
||||
}
|
||||
Reference in New Issue
Block a user