Skip to content

Commit

Permalink
Update valueUtil.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan authored Nov 26, 2023
1 parent 0e49551 commit c2ef312
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/valueUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ interface GetColumnKeyColumn {

export function getColumnsKey(columns: readonly GetColumnKeyColumn[]) {
const columnKeys: React.Key[] = [];
const keys: Record<React.Key, boolean> = {};
const keys: Record<PropertyKey, boolean> = {};

columns.forEach(column => {
const { key, dataIndex } = column || {};

let mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;
while (keys[mergedKey]) {
while (keys[mergedKey as string]) {
mergedKey = `${mergedKey}_next`;
}
keys[mergedKey] = true;
keys[mergedKey as string] = true;

columnKeys.push(mergedKey);
});
Expand Down

0 comments on commit c2ef312

Please sign in to comment.