File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
packages/firestore/test/unit/util Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,16 @@ import { expect } from 'chai';
18
18
import { Bundle , toReadableStream } from '../../../src/util/bundle' ;
19
19
import { isNode } from '../../util/test_platform' ;
20
20
21
- const encoder = new TextEncoder ( ) ;
22
-
23
21
function readableStreamFromString (
24
22
content : string ,
25
23
bytesPerRead : number
26
24
) : ReadableStream {
27
- return toReadableStream ( encoder . encode ( content ) , bytesPerRead ) ;
25
+ return toReadableStream ( new TextEncoder ( ) . encode ( content ) , bytesPerRead ) ;
28
26
}
29
27
30
28
function lengthPrefixedString ( o : { } ) : string {
31
29
const str = JSON . stringify ( o ) ;
32
- const l = encoder . encode ( str ) . byteLength ;
30
+ const l = new TextEncoder ( ) . encode ( str ) . byteLength ;
33
31
return `${ l } ${ str } ` ;
34
32
}
35
33
You can’t perform that action at this time.
0 commit comments