@firebase/storage 0.9.12 → 0.9.13-canary.0c0c58f47

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  #Unreleased
2
2
 
3
+ ## 0.9.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`de1c717c2`](https://github.com/firebase/firebase-js-sdk/commit/de1c717c2f69e9f21744135b74f92829927b200b) [#6705](https://github.com/firebase/firebase-js-sdk/pull/6705) - Fixed issue where clients using Node.js v18 would use the native `Blob` object which is incompatible with `node-fetch`
8
+
9
+ - [`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5) [#6682](https://github.com/firebase/firebase-js-sdk/pull/6682) - Upgrade TypeScript to 4.7.4.
10
+
11
+ - Updated dependencies [[`4af28c1a4`](https://github.com/firebase/firebase-js-sdk/commit/4af28c1a42bd25ce2353f694ca1724c6101cbce5)]:
12
+ - @firebase/component@0.5.21
13
+ - @firebase/util@1.7.3
14
+
3
15
  ## 0.9.12
4
16
 
5
17
  ### Patch Changes
@@ -185,6 +185,9 @@ function serverFileWrongSize() {
185
185
  function noDownloadURL() {
186
186
  return new StorageError("no-download-url" /* NO_DOWNLOAD_URL */, 'The given file does not have any download URLs.');
187
187
  }
188
+ function missingPolyFill(polyFill) {
189
+ 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.");
190
+ }
188
191
  /**
189
192
  * @internal
190
193
  */
@@ -536,7 +539,9 @@ function isNativeBlob(p) {
536
539
  return isNativeBlobDefined() && p instanceof Blob;
537
540
  }
538
541
  function isNativeBlobDefined() {
539
- return typeof Blob !== 'undefined';
542
+ // Note: The `isNode()` check can be removed when `node-fetch` adds native Blob support
543
+ // PR: https://github.com/node-fetch/node-fetch/pull/1664
544
+ return typeof Blob !== 'undefined' && !util.isNode();
540
545
  }
541
546
  function validateNumber(argument, minValue, maxValue, value) {
542
547
  if (value < minValue) {
@@ -948,6 +953,9 @@ function sliceBlob(blob, start, end) {
948
953
  */
949
954
  /** Converts a Base64 encoded string to a binary string. */
950
955
  function decodeBase64(encoded) {
956
+ if (typeof atob === 'undefined') {
957
+ throw missingPolyFill('base-64');
958
+ }
951
959
  return atob(encoded);
952
960
  }
953
961
 
@@ -1109,6 +1117,9 @@ function base64Bytes_(format, value) {
1109
1117
  bytes = decodeBase64(value);
1110
1118
  }
1111
1119
  catch (e) {
1120
+ if (e.message.includes('polyfill')) {
1121
+ throw e;
1122
+ }
1112
1123
  throw invalidFormat(format, 'Invalid character found');
1113
1124
  }
1114
1125
  var array = new Uint8Array(bytes.length);
@@ -3489,7 +3500,7 @@ var FirebaseStorageImpl = /** @class */ (function () {
3489
3500
  }());
3490
3501
 
3491
3502
  var name = "@firebase/storage";
3492
- var version = "0.9.12";
3503
+ var version = "0.9.13-canary.0c0c58f47";
3493
3504
 
3494
3505
  /**
3495
3506
  * @license