@firebase/util 1.9.6 → 1.9.7-20240702143745

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.
@@ -792,7 +792,15 @@ function isNode() {
792
792
  * Detect Browser Environment
793
793
  */
794
794
  function isBrowser() {
795
- return typeof self === 'object' && self.self === self;
795
+ return typeof window !== 'undefined' || isWebWorker();
796
+ }
797
+ /**
798
+ * Detect Web Worker context
799
+ */
800
+ function isWebWorker() {
801
+ return (typeof WorkerGlobalScope !== 'undefined' &&
802
+ typeof self !== 'undefined' &&
803
+ self instanceof WorkerGlobalScope);
796
804
  }
797
805
  function isBrowserExtension() {
798
806
  var runtime = typeof chrome === 'object'
@@ -2179,6 +2187,7 @@ exports.isSafari = isSafari;
2179
2187
  exports.isUWP = isUWP;
2180
2188
  exports.isValidFormat = isValidFormat;
2181
2189
  exports.isValidTimestamp = isValidTimestamp;
2190
+ exports.isWebWorker = isWebWorker;
2182
2191
  exports.issuedAtTime = issuedAtTime;
2183
2192
  exports.jsonEval = jsonEval;
2184
2193
  exports.map = map;