feat: Expose GuardedStream.

This commit is contained in:
Ruben Verborgh 2021-01-02 14:18:44 +01:00
parent 4df11c1932
commit 166c4de493
2 changed files with 4 additions and 3 deletions

View File

@ -192,6 +192,7 @@ export * from './util/locking/WrappedExpiringResourceLocker';
// Util // Util
export * from './util/AsyncHandler'; export * from './util/AsyncHandler';
export * from './util/ContentTypes'; export * from './util/ContentTypes';
export * from './util/GuardedStream';
export * from './util/HeaderUtil'; export * from './util/HeaderUtil';
export * from './util/PathUtil'; export * from './util/PathUtil';
export * from './util/QuadUtil'; export * from './util/QuadUtil';

View File

@ -25,9 +25,9 @@ interface StoredErrorStream extends NodeJS.EventEmitter {
} }
/** /**
* A stream that is guarded. * A stream that is guarded from emitting errors when there are no listeners.
* This means that if this stream emits an error before a listener is attached, * If an error occurs while no listener is attached,
* it will store the error and emit it once a listener is added. * it will store the error and emit it once a listener is added (or a timeout occurs).
*/ */
export type Guarded<T extends NodeJS.EventEmitter> = T & Guard; export type Guarded<T extends NodeJS.EventEmitter> = T & Guard;