@firebase/storage 0.9.13 → 0.9.14-canary.e9fb4037f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -168,6 +168,9 @@ function serverFileWrongSize() {
168
168
  function noDownloadURL() {
169
169
  return new StorageError("no-download-url" /* NO_DOWNLOAD_URL */, 'The given file does not have any download URLs.');
170
170
  }
171
+ function missingPolyFill(polyFill) {
172
+ return new StorageError("unsupported-environment" /* UNSUPPORTED_ENVIRONMENT */, `${polyFill} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);
173
+ }
171
174
  /**
172
175
  * @internal
173
176
  */
@@ -904,6 +907,9 @@ function sliceBlob(blob, start, end) {
904
907
  */
905
908
  /** Converts a Base64 encoded string to a binary string. */
906
909
  function decodeBase64(encoded) {
910
+ if (typeof atob === 'undefined') {
911
+ throw missingPolyFill('base-64');
912
+ }
907
913
  return atob(encoded);
908
914
  }
909
915
 
@@ -1064,6 +1070,9 @@ function base64Bytes_(format, value) {
1064
1070
  bytes = decodeBase64(value);
1065
1071
  }
1066
1072
  catch (e) {
1073
+ if (e.message.includes('polyfill')) {
1074
+ throw e;
1075
+ }
1067
1076
  throw invalidFormat(format, 'Invalid character found');
1068
1077
  }
1069
1078
  const array = new Uint8Array(bytes.length);
@@ -3305,7 +3314,7 @@ class FirebaseStorageImpl {
3305
3314
  }
3306
3315
 
3307
3316
  const name = "@firebase/storage";
3308
- const version = "0.9.13";
3317
+ const version = "0.9.14-canary.e9fb4037f";
3309
3318
 
3310
3319
  /**
3311
3320
  * @license