@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.
@@ -785,7 +785,7 @@ function isNode() {
785
785
  }
786
786
  }
787
787
  /**
788
- * Detect Browser Environment
788
+ * Detect Browser Environment.
789
789
  * Note: This will return true for certain test frameworks that are incompletely
790
790
  * mimicking a browser, and should not lead to assuming all browser APIs are
791
791
  * available.
@@ -794,13 +794,20 @@ function isBrowser() {
794
794
  return typeof window !== 'undefined' || isWebWorker();
795
795
  }
796
796
  /**
797
- * Detect Web Worker context
797
+ * Detect Web Worker context.
798
798
  */
799
799
  function isWebWorker() {
800
800
  return (typeof WorkerGlobalScope !== 'undefined' &&
801
801
  typeof self !== 'undefined' &&
802
802
  self instanceof WorkerGlobalScope);
803
803
  }
804
+ /**
805
+ * Detect Cloudflare Worker context.
806
+ */
807
+ function isCloudflareWorker() {
808
+ return (typeof navigator !== 'undefined' &&
809
+ navigator.userAgent === 'Cloudflare-Workers');
810
+ }
804
811
  function isBrowserExtension() {
805
812
  var runtime = typeof chrome === 'object'
806
813
  ? chrome.runtime
@@ -2118,63 +2125,5 @@ function getModularInstance(service) {
2118
2125
  }
2119
2126
  }
2120
2127
 
2121
- /**
2122
- * @license
2123
- * Copyright 2023 Google LLC
2124
- *
2125
- * Licensed under the Apache License, Version 2.0 (the "License");
2126
- * you may not use this file except in compliance with the License.
2127
- * You may obtain a copy of the License at
2128
- *
2129
- * http://www.apache.org/licenses/LICENSE-2.0
2130
- *
2131
- * Unless required by applicable law or agreed to in writing, software
2132
- * distributed under the License is distributed on an "AS IS" BASIS,
2133
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2134
- * See the License for the specific language governing permissions and
2135
- * limitations under the License.
2136
- */
2137
- var FetchProvider = /** @class */ (function () {
2138
- function FetchProvider() {
2139
- }
2140
- FetchProvider.initialize = function (fetchImpl, headersImpl, responseImpl) {
2141
- this.fetchImpl = fetchImpl;
2142
- if (headersImpl) {
2143
- this.headersImpl = headersImpl;
2144
- }
2145
- if (responseImpl) {
2146
- this.responseImpl = responseImpl;
2147
- }
2148
- };
2149
- FetchProvider.fetch = function () {
2150
- if (this.fetchImpl) {
2151
- return this.fetchImpl;
2152
- }
2153
- if (typeof self !== 'undefined' && 'fetch' in self) {
2154
- return self.fetch;
2155
- }
2156
- throw new Error('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2157
- };
2158
- FetchProvider.headers = function () {
2159
- if (this.headersImpl) {
2160
- return this.headersImpl;
2161
- }
2162
- if (typeof self !== 'undefined' && 'Headers' in self) {
2163
- return self.Headers;
2164
- }
2165
- throw new Error('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2166
- };
2167
- FetchProvider.response = function () {
2168
- if (this.responseImpl) {
2169
- return this.responseImpl;
2170
- }
2171
- if (typeof self !== 'undefined' && 'Response' in self) {
2172
- return self.Response;
2173
- }
2174
- throw new Error('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2175
- };
2176
- return FetchProvider;
2177
- }());
2178
-
2179
- export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FetchProvider, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
2128
+ export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isCloudflareWorker, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
2180
2129
  //# sourceMappingURL=index.esm5.js.map