@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.
@@ -37,4 +37,3 @@ export * from './src/exponential_backoff';
37
37
  export * from './src/formatters';
38
38
  export * from './src/compat';
39
39
  export * from './src/global';
40
- export * from './src/fetch_provider';
@@ -37,4 +37,3 @@ export * from './src/exponential_backoff';
37
37
  export * from './src/formatters';
38
38
  export * from './src/compat';
39
39
  export * from './src/global';
40
- export * from './src/fetch_provider';
@@ -37,4 +37,3 @@ export * from './src/exponential_backoff';
37
37
  export * from './src/formatters';
38
38
  export * from './src/compat';
39
39
  export * from './src/global';
40
- export * from './src/fetch_provider';
@@ -775,7 +775,7 @@ function isNode() {
775
775
  }
776
776
  }
777
777
  /**
778
- * Detect Browser Environment
778
+ * Detect Browser Environment.
779
779
  * Note: This will return true for certain test frameworks that are incompletely
780
780
  * mimicking a browser, and should not lead to assuming all browser APIs are
781
781
  * available.
@@ -784,13 +784,20 @@ function isBrowser() {
784
784
  return typeof window !== 'undefined' || isWebWorker();
785
785
  }
786
786
  /**
787
- * Detect Web Worker context
787
+ * Detect Web Worker context.
788
788
  */
789
789
  function isWebWorker() {
790
790
  return (typeof WorkerGlobalScope !== 'undefined' &&
791
791
  typeof self !== 'undefined' &&
792
792
  self instanceof WorkerGlobalScope);
793
793
  }
794
+ /**
795
+ * Detect Cloudflare Worker context.
796
+ */
797
+ function isCloudflareWorker() {
798
+ return (typeof navigator !== 'undefined' &&
799
+ navigator.userAgent === 'Cloudflare-Workers');
800
+ }
794
801
  function isBrowserExtension() {
795
802
  const runtime = typeof chrome === 'object'
796
803
  ? chrome.runtime
@@ -2120,61 +2127,6 @@ function getModularInstance(service) {
2120
2127
  }
2121
2128
  }
2122
2129
 
2123
- /**
2124
- * @license
2125
- * Copyright 2023 Google LLC
2126
- *
2127
- * Licensed under the Apache License, Version 2.0 (the "License");
2128
- * you may not use this file except in compliance with the License.
2129
- * You may obtain a copy of the License at
2130
- *
2131
- * http://www.apache.org/licenses/LICENSE-2.0
2132
- *
2133
- * Unless required by applicable law or agreed to in writing, software
2134
- * distributed under the License is distributed on an "AS IS" BASIS,
2135
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2136
- * See the License for the specific language governing permissions and
2137
- * limitations under the License.
2138
- */
2139
- class FetchProvider {
2140
- static initialize(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
- static fetch() {
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
- static headers() {
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
- static response() {
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
- }
2177
-
2178
2130
  /**
2179
2131
  * @license
2180
2132
  * Copyright 2017 Google LLC
@@ -2194,5 +2146,5 @@ class FetchProvider {
2194
2146
  // Overriding the constant (we should be the only ones doing this)
2195
2147
  CONSTANTS.NODE_CLIENT = true;
2196
2148
 
2197
- 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 };
2149
+ 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 };
2198
2150
  //# sourceMappingURL=index.node.esm.js.map