This repository was archived by the owner on May 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -11,20 +11,22 @@ class AWSApiReadStream extends Readable {
1111 async _read ( size ) {
1212 try {
1313 const res = await this . _fn ( this . _nextToken )
14- if ( this . _isInBufferMode ( ) ) {
15- this . _buffer . push ( res )
16- }
14+ if ( res ) {
15+ if ( this . _isInBufferMode ( ) ) {
16+ this . _buffer . push ( res )
17+ }
1718
18- this . push ( res )
19+ this . push ( res )
1920
20- if ( res && res . NextToken !== undefined ) {
21- this . _nextToken = res . NextToken
22- return
23- }
21+ if ( res . NextToken !== undefined ) {
22+ this . _nextToken = res . NextToken
23+ return
24+ }
2425
25- if ( res && res . NextContinuationToken !== undefined ) {
26- this . _nextToken = res . NextContinuationToken
27- return
26+ if ( res . NextContinuationToken !== undefined ) {
27+ this . _nextToken = res . NextContinuationToken
28+ return
29+ }
2830 }
2931
3032 this . push ( null )
@@ -33,6 +35,11 @@ class AWSApiReadStream extends Readable {
3335 }
3436 }
3537
38+ stop ( ) {
39+ this . _stop = true
40+ this . destroy ( )
41+ }
42+
3643 static from ( fn , { nextToken, options } = { } ) {
3744 return new AWSApiReadStream ( fn , options , nextToken )
3845 }
You can’t perform that action at this time.
0 commit comments