import { AsyncIterableX } from './asynciterablex' ; import { throwIfAborted } from '../aborterror' ; class ThrowAsyncIterable extends AsyncIterableX < never > { private _error : any ; constructor ( error ) { super ( ) ; this . _error = error ; } async * [ Symbol . asyncIterator ] ( signal ? ) { throwIfAborted ( signal ) ; throw this . _error ; } } param { * } error returns { AsyncIterableX < never > } export function throwError ( error ) { return new ThrowAsyncIterable ( error ) ; }