ant-design/components/_util/transKeys.ts
lijianan 9aec72c395
chore: remove useless tsx support (#39890)
* chore: remove useless tsx support

* add

* add

* style

* fix lint

* fix lint

* fix lint

* update locale entry

* update locale entry

* update locale entry

* delete useless style
2022-12-29 18:33:13 +08:00

18 lines
435 B
TypeScript

export const groupKeysMap = (keys: string[]) => {
const map = new Map<string, number>();
keys.forEach((key, index) => {
map.set(key, index);
});
return map;
};
export const groupDisabledKeysMap = <RecordType extends any[]>(dataSource: RecordType) => {
const map = new Map<string, number>();
dataSource.forEach(({ disabled, key }, index) => {
if (disabled) {
map.set(key, index);
}
});
return map;
};