From 166c4de493d6f68da9197fe727901d24d4d86eaa Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Sat, 2 Jan 2021 14:18:44 +0100 Subject: [PATCH] feat: Expose GuardedStream. --- src/index.ts | 1 + src/util/GuardedStream.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 327dafd24..d3866fcc9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -192,6 +192,7 @@ export * from './util/locking/WrappedExpiringResourceLocker'; // Util export * from './util/AsyncHandler'; export * from './util/ContentTypes'; +export * from './util/GuardedStream'; export * from './util/HeaderUtil'; export * from './util/PathUtil'; export * from './util/QuadUtil'; diff --git a/src/util/GuardedStream.ts b/src/util/GuardedStream.ts index 4be44e393..6b55376bb 100644 --- a/src/util/GuardedStream.ts +++ b/src/util/GuardedStream.ts @@ -25,9 +25,9 @@ interface StoredErrorStream extends NodeJS.EventEmitter { } /** - * A stream that is guarded. - * This means that if this stream emits an error before a listener is attached, - * it will store the error and emit it once a listener is added. + * A stream that is guarded from emitting errors when there are no listeners. + * If an error occurs while no listener is attached, + * it will store the error and emit it once a listener is added (or a timeout occurs). */ export type Guarded = T & Guard;