index.ts 648 B

1234567891011121314151617181920
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { EntityModule } from '#desktop/components/CommonSimpleEntityList/types.ts'
  3. import { EntityType } from '#desktop/components/CommonSimpleEntityList/types.ts'
  4. const modules = import.meta.glob<EntityModule>(['./*.ts', '!./index.ts'], {
  5. eager: true,
  6. import: 'default',
  7. })
  8. const entityModules = Object.entries(modules).reduce(
  9. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  10. (acc, [_, module]) => {
  11. acc[module.type] = module
  12. return acc
  13. },
  14. {} as Record<EntityType, (typeof modules)[EntityType]>,
  15. )
  16. export default entityModules