Skip to content

Commit 611993b

Browse files
authored
type: fix master CI fail again (ant-design#48045)
* TEST: DO NOT MERGE * fix: fix type
1 parent 212b1ee commit 611993b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

components/table/hooks/useSorter.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,17 @@ const stateToInfo = <RecordType extends any>(
262262
sorterStates: SortState<RecordType>,
263263
): SorterResult<RecordType> => {
264264
const { column, sortOrder } = sorterStates;
265-
return { column, order: sortOrder, field: column.dataIndex, columnKey: column.key };
265+
return {
266+
column,
267+
order: sortOrder,
268+
field: column.dataIndex as SorterResult<RecordType>['field'],
269+
columnKey: column.key,
270+
};
266271
};
267272

268-
function generateSorterInfo<RecordType>(
273+
const generateSorterInfo = <RecordType extends any>(
269274
sorterStates: SortState<RecordType>[],
270-
): SorterResult<RecordType> | SorterResult<RecordType>[] {
275+
): SorterResult<RecordType> | SorterResult<RecordType>[] => {
271276
const list = sorterStates
272277
.filter(({ sortOrder }) => sortOrder)
273278
.map<SorterResult<RecordType>>(stateToInfo);
@@ -287,7 +292,7 @@ function generateSorterInfo<RecordType>(
287292
}
288293

289294
return list;
290-
}
295+
};
291296

292297
export function getSortData<RecordType>(
293298
data: readonly RecordType[],

0 commit comments

Comments
 (0)