Discord-InterChat/InterChat

View on GitHub
src/managers/InfractionManager/InfractionManagerFactory.ts

Summary

Maintainability
A
0 mins
Test Coverage
import ServerInfractionManager from './ServerInfractionManager.js';
import UserInfractionManager from './UserInfractionManager.js';

export class InfractionManagerFactory {
  static create(type: 'user' | 'server', targetId: string) {
    return type === 'server'
      ? new ServerInfractionManager(targetId)
      : new UserInfractionManager(targetId);
  }
}