mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export function createEnumMap<T extends Record<string, string | number>>(
|
||||
EnumObject: T
|
||||
) {
|
||||
return Object.entries(EnumObject).reduce(
|
||||
(acc, [key, value]) => {
|
||||
acc[value as T[keyof T]] = key as keyof T;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<T[keyof T], keyof T>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user