@firebase/util 1.9.7-canary.fa0ed08fb → 1.9.7-canary.ff0475c41

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/dist/index.cjs.js CHANGED
@@ -779,7 +779,7 @@ function isNode() {
779
779
  }
780
780
  }
781
781
  /**
782
- * Detect Browser Environment
782
+ * Detect Browser Environment.
783
783
  * Note: This will return true for certain test frameworks that are incompletely
784
784
  * mimicking a browser, and should not lead to assuming all browser APIs are
785
785
  * available.
@@ -788,13 +788,20 @@ function isBrowser() {
788
788
  return typeof window !== 'undefined' || isWebWorker();
789
789
  }
790
790
  /**
791
- * Detect Web Worker context
791
+ * Detect Web Worker context.
792
792
  */
793
793
  function isWebWorker() {
794
794
  return (typeof WorkerGlobalScope !== 'undefined' &&
795
795
  typeof self !== 'undefined' &&
796
796
  self instanceof WorkerGlobalScope);
797
797
  }
798
+ /**
799
+ * Detect Cloudflare Worker context.
800
+ */
801
+ function isCloudflareWorker() {
802
+ return (typeof navigator !== 'undefined' &&
803
+ navigator.userAgent === 'Cloudflare-Workers');
804
+ }
798
805
  function isBrowserExtension() {
799
806
  const runtime = typeof chrome === 'object'
800
807
  ? chrome.runtime
@@ -2161,6 +2168,7 @@ exports.getUA = getUA;
2161
2168
  exports.isAdmin = isAdmin;
2162
2169
  exports.isBrowser = isBrowser;
2163
2170
  exports.isBrowserExtension = isBrowserExtension;
2171
+ exports.isCloudflareWorker = isCloudflareWorker;
2164
2172
  exports.isElectron = isElectron;
2165
2173
  exports.isEmpty = isEmpty;
2166
2174
  exports.isIE = isIE;