Skip to content

Commit 9f03d92

Browse files
committed
Start addressing comments
1 parent f6e47dc commit 9f03d92

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/storage/compat/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function factory(
4949
return new StorageServiceCompat(
5050
new StorageService(app, authProvider, new XhrIoPool(), url),
5151
ref => new ReferenceCompat(ref)
52-
) as types.FirebaseStorage;
52+
);
5353
}
5454

5555
export function registerStorage(instance: _FirebaseNamespace): void {

packages/storage/src/reference.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Reference {
103103
return getParent(this);
104104
}
105105

106-
throwIfRoot_(name: string): void {
106+
_throwIfRoot(name: string): void {
107107
if (this.location.path === '') {
108108
throw invalidRootOperation(name);
109109
}
@@ -128,7 +128,7 @@ export function uploadBytes(
128128
if (metadata != null) {
129129
metadataValidator(metadata);
130130
}
131-
ref.throwIfRoot_('uploadBytes');
131+
ref._throwIfRoot('uploadBytes');
132132
return new UploadTask(ref, new FbsBlob(data), metadata);
133133
}
134134

@@ -159,7 +159,7 @@ export function uploadString(
159159
if (metadata != null) {
160160
metadataValidator(metadata);
161161
}
162-
ref.throwIfRoot_('putString');
162+
ref._throwIfRoot('putString');
163163
const data = dataFromString(format, value);
164164
const metadataClone = { ...metadata } as Metadata;
165165
if (metadataClone['contentType'] == null && data.contentType != null) {
@@ -270,7 +270,7 @@ export function list(
270270
* @param ref - Storage Reference to get metadata from.
271271
*/
272272
export function getMetadata(ref: Reference): Promise<Metadata> {
273-
ref.throwIfRoot_('getMetadata');
273+
ref._throwIfRoot('getMetadata');
274274
return ref.service.getAuthToken().then(authToken => {
275275
const requestInfo = requests.getMetadata(
276276
ref.service,
@@ -297,7 +297,7 @@ export function updateMetadata(
297297
metadata: Metadata
298298
): Promise<Metadata> {
299299
metadataValidator(metadata);
300-
ref.throwIfRoot_('updateMetadata');
300+
ref._throwIfRoot('updateMetadata');
301301
return ref.service.getAuthToken().then(authToken => {
302302
const requestInfo = requests.updateMetadata(
303303
ref.service,
@@ -315,7 +315,7 @@ export function updateMetadata(
315315
* URL for this object.
316316
*/
317317
export function getDownloadURL(ref: Reference): Promise<string> {
318-
ref.throwIfRoot_('getDownloadURL');
318+
ref._throwIfRoot('getDownloadURL');
319319
return ref.service.getAuthToken().then(authToken => {
320320
const requestInfo = requests.getDownloadUrl(
321321
ref.service,
@@ -341,7 +341,7 @@ export function getDownloadURL(ref: Reference): Promise<string> {
341341
* @returns A promise that resolves if the deletion succeeds.
342342
*/
343343
export function deleteObject(ref: Reference): Promise<void> {
344-
ref.throwIfRoot_('deleteObject');
344+
ref._throwIfRoot('deleteObject');
345345
return ref.service.getAuthToken().then(authToken => {
346346
const requestInfo = requests.deleteObject(ref.service, ref.location);
347347
return ref.service.makeRequest(requestInfo, authToken).getPromise();

0 commit comments

Comments
 (0)