File tree Expand file tree Collapse file tree 5 files changed +399
-1531
lines changed Expand file tree Collapse file tree 5 files changed +399
-1531
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ module.exports = function (config) {
14
14
webpack : {
15
15
resolve : {
16
16
extensions : [ ".ts" , ".js" ] ,
17
+ fallback : {
18
+ stream : false ,
19
+ } ,
17
20
} ,
18
21
mode : "development" ,
19
22
module : {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { Credentials } from "@aws-sdk/types";
7
7
import chai from "chai" ;
8
8
import chaiAsPromised from "chai-as-promised" ;
9
9
10
- import { S3 } from "../../src/index" ;
10
+ import { S3 , SelectObjectContentEventStream } from "../../src/index" ;
11
11
import { createBuffer } from "./helpers" ;
12
12
chai . use ( chaiAsPromised ) ;
13
13
const { expect } = chai ;
@@ -278,13 +278,13 @@ esfuture,29`;
278
278
CSV : { } ,
279
279
} ,
280
280
} ) ;
281
- const events = [ ] ;
282
- for await ( const event of Payload ) {
281
+ const events : SelectObjectContentEventStream [ ] = [ ] ;
282
+ for await ( const event of Payload ! ) {
283
283
events . push ( event ) ;
284
284
}
285
285
expect ( events . length ) . to . equal ( 3 ) ;
286
- expect ( Buffer . from ( events [ 0 ] . Records . Payload ) . toString ( "utf8" ) ) . to . equal ( "node4life\nesfuture\n" ) ;
287
- expect ( events [ 1 ] . Stats . Details ) . to . be . exist ;
286
+ expect ( new TextDecoder ( ) . decode ( events [ 0 ] . Records ? .Payload ) ) . to . equal ( "node4life\nesfuture\n" ) ;
287
+ expect ( events [ 1 ] . Stats ? .Details ) . to . be . exist ;
288
288
expect ( events [ 2 ] . End ) . to . be . exist ;
289
289
} ) ;
290
290
} ) ;
Original file line number Diff line number Diff line change 1
1
export const createBuffer = ( size : string ) => {
2
- var match ;
3
- var buffer ;
4
- if ( ( match = size . match ( / ( \d + ) K B / ) ) ) {
5
- buffer = Buffer . alloc ( parseInt ( match [ 1 ] ) * 1024 ) ;
6
- } else if ( ( match = size . match ( / ( \d + ) M B / ) ) ) {
7
- buffer = Buffer . alloc ( parseInt ( match [ 1 ] ) * 1024 * 1024 ) ;
2
+ const KB_REGEX = / ( \d + ) K B / ;
3
+ const MB_REGEX = / ( \d + ) M B / ;
4
+ if ( KB_REGEX . test ( size ) ) {
5
+ return new Uint8Array ( parseInt ( size . match ( KB_REGEX ) ! [ 1 ] ) * 1024 ) . fill ( 0x78 ) ;
6
+ } else if ( MB_REGEX . test ( size ) ) {
7
+ return new Uint8Array ( parseInt ( size . match ( MB_REGEX ) ! [ 1 ] ) * 1024 * 1024 ) . fill ( 0x78 ) ;
8
8
} else {
9
- buffer = Buffer . alloc ( 1024 * 1024 ) ;
9
+ return new Uint8Array ( 1024 * 1024 ) . fill ( 0x78 ) ;
10
10
}
11
- buffer . fill ( "x" ) ;
12
- return buffer ;
13
11
} ;
Original file line number Diff line number Diff line change 110
110
"typedoc-plugin-lerna-packages" : " 0.3.1" ,
111
111
"typescript" : " ~4.6.2" ,
112
112
"verdaccio" : " 4.13.2" ,
113
- "webpack" : " ^4.43 .0" ,
114
- "webpack-cli" : " ^3.3.12 " ,
113
+ "webpack" : " 5.73 .0" ,
114
+ "webpack-cli" : " 4.10.0 " ,
115
115
"yarn" : " 1.22.10"
116
116
},
117
117
"workspaces" : {
You can’t perform that action at this time.
0 commit comments