@firebase/database 1.0.6-canary.4b4db85ff → 1.0.6-canary.62661245f

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.
@@ -608,7 +608,7 @@ var isWindowsStoreApp = function () {
608
608
  return typeof Windows === 'object' && typeof Windows.UI === 'object';
609
609
  };
610
610
  /**
611
- * Converts a server error code to a Javascript Error
611
+ * Converts a server error code to a JavaScript Error
612
612
  */
613
613
  function errorForServerCode(code, query) {
614
614
  var reason = 'Unknown Error';
@@ -637,7 +637,7 @@ var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
637
637
  */
638
638
  var INTEGER_32_MIN = -2147483648;
639
639
  /**
640
- * For use in kyes, the maximum possible 32-bit integer.
640
+ * For use in keys, the maximum possible 32-bit integer.
641
641
  */
642
642
  var INTEGER_32_MAX = 2147483647;
643
643
  /**
@@ -1300,7 +1300,7 @@ var WebSocketConnection = /** @class */ (function () {
1300
1300
  }());
1301
1301
 
1302
1302
  var name = "@firebase/database";
1303
- var version = "1.0.6-canary.4b4db85ff";
1303
+ var version = "1.0.6-canary.62661245f";
1304
1304
 
1305
1305
  /**
1306
1306
  * @license
@@ -1338,7 +1338,7 @@ var AppCheckTokenProvider = /** @class */ (function () {
1338
1338
  // Support delayed initialization of FirebaseAppCheck. This allows our
1339
1339
  // customers to initialize the RTDB SDK before initializing Firebase
1340
1340
  // AppCheck and ensures that all requests are authenticated if a token
1341
- // becomes available before the timoeout below expires.
1341
+ // becomes available before the timeout below expires.
1342
1342
  setTimeout(function () {
1343
1343
  if (_this.appCheck) {
1344
1344
  _this.getToken(forceRefresh).then(resolve, reject);
@@ -1400,7 +1400,7 @@ var FirebaseAuthTokenProvider = /** @class */ (function () {
1400
1400
  // Support delayed initialization of FirebaseAuth. This allows our
1401
1401
  // customers to initialize the RTDB SDK before initializing Firebase
1402
1402
  // Auth and ensures that all requests are authenticated if a token
1403
- // becomes available before the timoeout below expires.
1403
+ // becomes available before the timeout below expires.
1404
1404
  setTimeout(function () {
1405
1405
  if (_this.auth_) {
1406
1406
  _this.getToken(forceRefresh).then(resolve, reject);
@@ -1894,7 +1894,7 @@ var BrowserPollConnection = /** @class */ (function () {
1894
1894
  *********************************************************************************************/
1895
1895
  var FirebaseIFrameScriptHolder = /** @class */ (function () {
1896
1896
  /**
1897
- * @param commandCB - The callback to be called when control commands are recevied from the server.
1897
+ * @param commandCB - The callback to be called when control commands are received from the server.
1898
1898
  * @param onMessageCB - The callback to be triggered when responses arrive from the server.
1899
1899
  * @param onDisconnect - The callback to be triggered when this tag holder is closed
1900
1900
  * @param urlFn - A function that provides the URL of the endpoint to send data to.
@@ -1939,6 +1939,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
1939
1939
  var iframeContents = '<html><body>' + script + '</body></html>';
1940
1940
  try {
1941
1941
  this.myIFrame.doc.open();
1942
+ // TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
1943
+ // library to sanitize the HTML in the iframeContents.
1942
1944
  this.myIFrame.doc.write(iframeContents);
1943
1945
  this.myIFrame.doc.close();
1944
1946
  }
@@ -2164,6 +2166,10 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
2164
2166
  var newScript_1 = _this.myIFrame.doc.createElement('script');
2165
2167
  newScript_1.type = 'text/javascript';
2166
2168
  newScript_1.async = true;
2169
+ // TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
2170
+ // at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
2171
+ // assign a sanitized trustedResourceURL to it. Since the URL must be a template string
2172
+ // literal, this could require some heavy refactoring.
2167
2173
  newScript_1.src = url;
2168
2174
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2169
2175
  newScript_1.onload = newScript_1.onreadystatechange =
@@ -10654,7 +10660,7 @@ function treeHasChildren(tree) {
10654
10660
  return tree.node.childCount > 0;
10655
10661
  }
10656
10662
  /**
10657
- * @returns Whethe rthe tree is empty (no value or children).
10663
+ * @returns Whether the tree is empty (no value or children).
10658
10664
  */
10659
10665
  function treeIsEmpty(tree) {
10660
10666
  return treeGetValue(tree) === undefined && !treeHasChildren(tree);
@@ -13065,7 +13071,7 @@ function push(parent, value) {
13065
13071
  // then() and catch() methods and is used as the return value of push(). The
13066
13072
  // second remains a regular Reference and is used as the fulfilled value of
13067
13073
  // the first ThennableReference.
13068
- var thennablePushRef = child(parent, name);
13074
+ var thenablePushRef = child(parent, name);
13069
13075
  var pushRef = child(parent, name);
13070
13076
  var promise;
13071
13077
  if (value != null) {
@@ -13074,9 +13080,9 @@ function push(parent, value) {
13074
13080
  else {
13075
13081
  promise = Promise.resolve(pushRef);
13076
13082
  }
13077
- thennablePushRef.then = promise.then.bind(promise);
13078
- thennablePushRef.catch = promise.then.bind(promise, undefined);
13079
- return thennablePushRef;
13083
+ thenablePushRef.then = promise.then.bind(promise);
13084
+ thenablePushRef.catch = promise.then.bind(promise, undefined);
13085
+ return thenablePushRef;
13080
13086
  }
13081
13087
  /**
13082
13088
  * Removes the data at this Database location.
@@ -14108,10 +14114,9 @@ function forceLongPolling() {
14108
14114
  BrowserPollConnection.forceAllow();
14109
14115
  }
14110
14116
  /**
14111
- * Returns the instance of the Realtime Database SDK that is associated
14112
- * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with
14113
- * with default settings if no instance exists or if the existing instance uses
14114
- * a custom database URL.
14117
+ * Returns the instance of the Realtime Database SDK that is associated with the provided
14118
+ * {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if
14119
+ * no instance exists or if the existing instance uses a custom database URL.
14115
14120
  *
14116
14121
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime
14117
14122
  * Database instance is associated with.