transKeys.js 386 B

1234567891011121314151617181920
  1. export const groupKeysMap = keys => {
  2. const map = new Map();
  3. keys.forEach((key, index) => {
  4. map.set(key, index);
  5. });
  6. return map;
  7. };
  8. export const groupDisabledKeysMap = dataSource => {
  9. const map = new Map();
  10. dataSource.forEach((_ref, index) => {
  11. let {
  12. disabled,
  13. key
  14. } = _ref;
  15. if (disabled) {
  16. map.set(key, index);
  17. }
  18. });
  19. return map;
  20. };