mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(editor): edgeless text toolbar config extension (#10811)
This commit is contained in:
@@ -11,13 +11,13 @@ export function getMostCommonValue<T, F extends keyof T>(
|
||||
return record?.[field];
|
||||
}
|
||||
|
||||
export function getMostCommonResolvedValue<
|
||||
T,
|
||||
F extends Exclude<keyof T, symbol>,
|
||||
U,
|
||||
>(records: T[], field: F, resolve: (value: T[F]) => U) {
|
||||
export function getMostCommonResolvedValue<T, F extends keyof T, U>(
|
||||
records: T[],
|
||||
field: F,
|
||||
resolve: (value: T[F]) => U
|
||||
) {
|
||||
return getMostCommonValue(
|
||||
records.map(record => ({ [field]: resolve(record[field]) })),
|
||||
field
|
||||
String(field)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user