Files
dify/web/utils/object.ts
Stephen Zhou a84c2d36a3 style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

10 lines
365 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)[]
}