19
19
* @fileoverview Defines the Firebase StorageReference class.
20
20
*/
21
21
22
- import { Transform , TransformOptions , PassThrough } from 'stream' ;
22
+ import { PassThrough , Transform , TransformOptions } from 'stream' ;
23
23
24
- import { FbsBlob } from './implementation/blob' ;
25
- import { Location } from './implementation/location' ;
26
- import { getMappings } from './implementation/metadata' ;
27
- import { child , parent , lastComponent } from './implementation/path' ;
24
+ import { FbsBlob } from './implementation/blob' ;
25
+ import { Location } from './implementation/location' ;
26
+ import { getMappings } from './implementation/metadata' ;
27
+ import { child , lastComponent , parent } from './implementation/path' ;
28
28
import {
29
- list as requestsList ,
30
- getMetadata as requestsGetMetadata ,
31
- updateMetadata as requestsUpdateMetadata ,
32
- getDownloadUrl as requestsGetDownloadUrl ,
33
29
deleteObject as requestsDeleteObject ,
34
- multipartUpload ,
35
30
getBytes ,
36
- getBlob ,
37
- getStream
31
+ getDownloadUrl as requestsGetDownloadUrl ,
32
+ getMetadata as requestsGetMetadata ,
33
+ list as requestsList ,
34
+ multipartUpload ,
35
+ updateMetadata as requestsUpdateMetadata
38
36
} from './implementation/requests' ;
39
- import { ListOptions , UploadResult } from './public-types' ;
40
- import { StringFormat , dataFromString } from './implementation/string' ;
41
- import { Metadata } from './metadata' ;
42
- import { FirebaseStorageImpl } from './service' ;
43
- import { ListResult } from './list' ;
44
- import { UploadTask } from './task' ;
45
- import { invalidRootOperation , noDownloadURL } from './implementation/error' ;
46
- import { validateNumber } from './implementation/type' ;
37
+ import { ListOptions , UploadResult } from './public-types' ;
38
+ import { dataFromString , StringFormat } from './implementation/string' ;
39
+ import { Metadata } from './metadata' ;
40
+ import { FirebaseStorageImpl } from './service' ;
41
+ import { ListResult } from './list' ;
42
+ import { UploadTask } from './task' ;
43
+ import { invalidRootOperation , noDownloadURL } from './implementation/error' ;
44
+ import { validateNumber } from './implementation/type' ;
47
45
import {
48
- newBytesConnection ,
49
- newTextConnection ,
50
46
newBlobConnection ,
51
- newStreamConnection
47
+ newBytesConnection ,
48
+ newStreamConnection ,
49
+ newTextConnection
52
50
} from './platform/connection' ;
53
51
54
52
/**
@@ -186,7 +184,7 @@ export function getBlobInternal(
186
184
maxDownloadSizeBytes ?: number
187
185
) : Promise < Blob > {
188
186
ref . _throwIfRoot ( 'getBlob' ) ;
189
- const requestInfo = getBlob ( ref . storage , ref . _location , maxDownloadSizeBytes ) ;
187
+ const requestInfo = getBytes ( ref . storage , ref . _location , maxDownloadSizeBytes ) ;
190
188
return ref . storage
191
189
. makeRequestWithTokens ( requestInfo , newBlobConnection )
192
190
. then ( blob =>
@@ -203,11 +201,7 @@ export function getStreamInternal(
203
201
maxDownloadSizeBytes ?: number
204
202
) : NodeJS . ReadableStream {
205
203
ref . _throwIfRoot ( 'getStream' ) ;
206
- const requestInfo = getStream (
207
- ref . storage ,
208
- ref . _location ,
209
- maxDownloadSizeBytes
210
- ) ;
204
+ const requestInfo = getBytes ( ref . storage , ref . _location , maxDownloadSizeBytes ) ;
211
205
212
206
/** A transformer that passes through the first n bytes. */
213
207
const newMaxSizeTransform : ( n : number ) => TransformOptions = n => {
0 commit comments