@firebase/util 1.9.5-canary.fe09d8338 → 1.9.5-dataconnect-preview.b8e015c81

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.
@@ -2111,6 +2111,64 @@ function getModularInstance(service) {
2111
2111
  }
2112
2112
  }
2113
2113
 
2114
+ /**
2115
+ * @license
2116
+ * Copyright 2023 Google LLC
2117
+ *
2118
+ * Licensed under the Apache License, Version 2.0 (the "License");
2119
+ * you may not use this file except in compliance with the License.
2120
+ * You may obtain a copy of the License at
2121
+ *
2122
+ * http://www.apache.org/licenses/LICENSE-2.0
2123
+ *
2124
+ * Unless required by applicable law or agreed to in writing, software
2125
+ * distributed under the License is distributed on an "AS IS" BASIS,
2126
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2127
+ * See the License for the specific language governing permissions and
2128
+ * limitations under the License.
2129
+ */
2130
+ var FetchProvider = /** @class */ (function () {
2131
+ function FetchProvider() {
2132
+ }
2133
+ FetchProvider.initialize = function (fetchImpl, headersImpl, responseImpl) {
2134
+ this.fetchImpl = fetchImpl;
2135
+ if (headersImpl) {
2136
+ this.headersImpl = headersImpl;
2137
+ }
2138
+ if (responseImpl) {
2139
+ this.responseImpl = responseImpl;
2140
+ }
2141
+ };
2142
+ FetchProvider.fetch = function () {
2143
+ if (this.fetchImpl) {
2144
+ return this.fetchImpl;
2145
+ }
2146
+ if (typeof self !== 'undefined' && 'fetch' in self) {
2147
+ return self.fetch;
2148
+ }
2149
+ throw new Error('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2150
+ };
2151
+ FetchProvider.headers = function () {
2152
+ if (this.headersImpl) {
2153
+ return this.headersImpl;
2154
+ }
2155
+ if (typeof self !== 'undefined' && 'Headers' in self) {
2156
+ return self.Headers;
2157
+ }
2158
+ throw new Error('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2159
+ };
2160
+ FetchProvider.response = function () {
2161
+ if (this.responseImpl) {
2162
+ return this.responseImpl;
2163
+ }
2164
+ if (typeof self !== 'undefined' && 'Response' in self) {
2165
+ return self.Response;
2166
+ }
2167
+ throw new Error('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2168
+ };
2169
+ return FetchProvider;
2170
+ }());
2171
+
2114
2172
  /**
2115
2173
  * @license
2116
2174
  * Copyright 2017 Google LLC
@@ -2134,6 +2192,7 @@ exports.CONSTANTS = CONSTANTS;
2134
2192
  exports.DecodeBase64StringError = DecodeBase64StringError;
2135
2193
  exports.Deferred = Deferred;
2136
2194
  exports.ErrorFactory = ErrorFactory;
2195
+ exports.FetchProvider = FetchProvider;
2137
2196
  exports.FirebaseError = FirebaseError;
2138
2197
  exports.MAX_VALUE_MILLIS = MAX_VALUE_MILLIS;
2139
2198
  exports.RANDOM_FACTOR = RANDOM_FACTOR;