@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.
package/dist/index.cjs.js CHANGED
@@ -782,7 +782,15 @@ function isNode() {
782
782
  * Detect Browser Environment
783
783
  */
784
784
  function isBrowser() {
785
- return typeof self === 'object' && self.self === self;
785
+ return typeof window !== 'undefined' || isWebWorker();
786
+ }
787
+ /**
788
+ * Detect Web Worker context
789
+ */
790
+ function isWebWorker() {
791
+ return (typeof WorkerGlobalScope !== 'undefined' &&
792
+ typeof self !== 'undefined' &&
793
+ self instanceof WorkerGlobalScope);
786
794
  }
787
795
  function isBrowserExtension() {
788
796
  const runtime = typeof chrome === 'object'
@@ -2162,6 +2170,7 @@ exports.isSafari = isSafari;
2162
2170
  exports.isUWP = isUWP;
2163
2171
  exports.isValidFormat = isValidFormat;
2164
2172
  exports.isValidTimestamp = isValidTimestamp;
2173
+ exports.isWebWorker = isWebWorker;
2165
2174
  exports.issuedAtTime = issuedAtTime;
2166
2175
  exports.jsonEval = jsonEval;
2167
2176
  exports.map = map;