@firebase/util 1.9.7 → 1.10.0-canary.1c8dbee46

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.
@@ -646,7 +646,7 @@ var Deferred = /** @class */ (function () {
646
646
  });
647
647
  }
648
648
  /**
649
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
649
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
650
650
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
651
651
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
652
652
  */
@@ -789,19 +789,29 @@ function isNode() {
789
789
  }
790
790
  }
791
791
  /**
792
- * Detect Browser Environment
792
+ * Detect Browser Environment.
793
+ * Note: This will return true for certain test frameworks that are incompletely
794
+ * mimicking a browser, and should not lead to assuming all browser APIs are
795
+ * available.
793
796
  */
794
797
  function isBrowser() {
795
798
  return typeof window !== 'undefined' || isWebWorker();
796
799
  }
797
800
  /**
798
- * Detect Web Worker context
801
+ * Detect Web Worker context.
799
802
  */
800
803
  function isWebWorker() {
801
804
  return (typeof WorkerGlobalScope !== 'undefined' &&
802
805
  typeof self !== 'undefined' &&
803
806
  self instanceof WorkerGlobalScope);
804
807
  }
808
+ /**
809
+ * Detect Cloudflare Worker context.
810
+ */
811
+ function isCloudflareWorker() {
812
+ return (typeof navigator !== 'undefined' &&
813
+ navigator.userAgent === 'Cloudflare-Workers');
814
+ }
805
815
  function isBrowserExtension() {
806
816
  var runtime = typeof chrome === 'object'
807
817
  ? chrome.runtime
@@ -1004,7 +1014,7 @@ function jsonEval(str) {
1004
1014
  }
1005
1015
  /**
1006
1016
  * Returns JSON representing a javascript object.
1007
- * @param {*} data Javascript object to be stringified.
1017
+ * @param {*} data JavaScript object to be stringified.
1008
1018
  * @return {string} The JSON contents of the object.
1009
1019
  */
1010
1020
  function stringify(data) {
@@ -1616,7 +1626,7 @@ var ObserverProxy = /** @class */ (function () {
1616
1626
  /**
1617
1627
  * Subscribe function that can be used to add an Observer to the fan-out list.
1618
1628
  *
1619
- * - We require that no event is sent to a subscriber sychronously to their
1629
+ * - We require that no event is sent to a subscriber synchronously to their
1620
1630
  * call to subscribe().
1621
1631
  */
1622
1632
  ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {
@@ -1886,7 +1896,7 @@ function validateContextObject(fnName, argumentName, context, optional) {
1886
1896
  // so it's been modified.
1887
1897
  // Note that not all Unicode characters appear as single characters in JavaScript strings.
1888
1898
  // fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
1889
- // use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first
1899
+ // use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first
1890
1900
  // character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
1891
1901
  // pair).
1892
1902
  // See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
@@ -2175,6 +2185,7 @@ exports.getUA = getUA;
2175
2185
  exports.isAdmin = isAdmin;
2176
2186
  exports.isBrowser = isBrowser;
2177
2187
  exports.isBrowserExtension = isBrowserExtension;
2188
+ exports.isCloudflareWorker = isCloudflareWorker;
2178
2189
  exports.isElectron = isElectron;
2179
2190
  exports.isEmpty = isEmpty;
2180
2191
  exports.isIE = isIE;