import { ProviderNotRegisteredException } from '../exception' ; import type { AbstractProvider } from '../model' ; import { AbstractDecider } from './abstract-decider' ; export class StatelessDecider extends AbstractDecider { async getProvider ( providers , forceProvider ? ) { if ( forceProvider ) { return forceProvider ; } if ( ! providers . length ) { throw ProviderNotRegisteredException . noProviderRegistered ( ) ; } return providers [ 0 ] ; } }