@firebase/util 1.9.7-dataconnect-preview.d986d4bf2 → 1.10.0-20240916151535

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.
@@ -789,7 +789,7 @@ function isNode() {
789
789
  }
790
790
  }
791
791
  /**
792
- * Detect Browser Environment
792
+ * Detect Browser Environment.
793
793
  * Note: This will return true for certain test frameworks that are incompletely
794
794
  * mimicking a browser, and should not lead to assuming all browser APIs are
795
795
  * available.
@@ -798,13 +798,20 @@ function isBrowser() {
798
798
  return typeof window !== 'undefined' || isWebWorker();
799
799
  }
800
800
  /**
801
- * Detect Web Worker context
801
+ * Detect Web Worker context.
802
802
  */
803
803
  function isWebWorker() {
804
804
  return (typeof WorkerGlobalScope !== 'undefined' &&
805
805
  typeof self !== 'undefined' &&
806
806
  self instanceof WorkerGlobalScope);
807
807
  }
808
+ /**
809
+ * Detect Cloudflare Worker context.
810
+ */
811
+ function isCloudflareWorker() {
812
+ return (typeof navigator !== 'undefined' &&
813
+ navigator.userAgent === 'Cloudflare-Workers');
814
+ }
808
815
  function isBrowserExtension() {
809
816
  var runtime = typeof chrome === 'object'
810
817
  ? chrome.runtime
@@ -2122,64 +2129,6 @@ function getModularInstance(service) {
2122
2129
  }
2123
2130
  }
2124
2131
 
2125
- /**
2126
- * @license
2127
- * Copyright 2023 Google LLC
2128
- *
2129
- * Licensed under the Apache License, Version 2.0 (the "License");
2130
- * you may not use this file except in compliance with the License.
2131
- * You may obtain a copy of the License at
2132
- *
2133
- * http://www.apache.org/licenses/LICENSE-2.0
2134
- *
2135
- * Unless required by applicable law or agreed to in writing, software
2136
- * distributed under the License is distributed on an "AS IS" BASIS,
2137
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2138
- * See the License for the specific language governing permissions and
2139
- * limitations under the License.
2140
- */
2141
- var FetchProvider = /** @class */ (function () {
2142
- function FetchProvider() {
2143
- }
2144
- FetchProvider.initialize = function (fetchImpl, headersImpl, responseImpl) {
2145
- this.fetchImpl = fetchImpl;
2146
- if (headersImpl) {
2147
- this.headersImpl = headersImpl;
2148
- }
2149
- if (responseImpl) {
2150
- this.responseImpl = responseImpl;
2151
- }
2152
- };
2153
- FetchProvider.fetch = function () {
2154
- if (this.fetchImpl) {
2155
- return this.fetchImpl;
2156
- }
2157
- if (typeof self !== 'undefined' && 'fetch' in self) {
2158
- return self.fetch;
2159
- }
2160
- throw new Error('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2161
- };
2162
- FetchProvider.headers = function () {
2163
- if (this.headersImpl) {
2164
- return this.headersImpl;
2165
- }
2166
- if (typeof self !== 'undefined' && 'Headers' in self) {
2167
- return self.Headers;
2168
- }
2169
- throw new Error('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2170
- };
2171
- FetchProvider.response = function () {
2172
- if (this.responseImpl) {
2173
- return this.responseImpl;
2174
- }
2175
- if (typeof self !== 'undefined' && 'Response' in self) {
2176
- return self.Response;
2177
- }
2178
- throw new Error('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2179
- };
2180
- return FetchProvider;
2181
- }());
2182
-
2183
2132
  /**
2184
2133
  * @license
2185
2134
  * Copyright 2017 Google LLC
@@ -2203,7 +2152,6 @@ exports.CONSTANTS = CONSTANTS;
2203
2152
  exports.DecodeBase64StringError = DecodeBase64StringError;
2204
2153
  exports.Deferred = Deferred;
2205
2154
  exports.ErrorFactory = ErrorFactory;
2206
- exports.FetchProvider = FetchProvider;
2207
2155
  exports.FirebaseError = FirebaseError;
2208
2156
  exports.MAX_VALUE_MILLIS = MAX_VALUE_MILLIS;
2209
2157
  exports.RANDOM_FACTOR = RANDOM_FACTOR;
@@ -2237,6 +2185,7 @@ exports.getUA = getUA;
2237
2185
  exports.isAdmin = isAdmin;
2238
2186
  exports.isBrowser = isBrowser;
2239
2187
  exports.isBrowserExtension = isBrowserExtension;
2188
+ exports.isCloudflareWorker = isCloudflareWorker;
2240
2189
  exports.isElectron = isElectron;
2241
2190
  exports.isEmpty = isEmpty;
2242
2191
  exports.isIE = isIE;