@firebase/database-compat 1.0.6-canary.9cd3c1eca → 1.0.6-canary.b284467c1

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.
@@ -28,7 +28,7 @@ export declare function createTestApp(): import("@firebase/app-compat").Firebase
28
28
  export declare function getRootNode(i?: number, ref?: string): any;
29
29
  /**
30
30
  * Create multiple refs to the same top level
31
- * push key - each on it's own Firebase.Context.
31
+ * push key - each on its own Firebase.Context.
32
32
  */
33
33
  export declare function getRandomNode(numNodes?: any): Reference | Reference[];
34
34
  export declare function getQueryValue(query: Query): Promise<unknown>;
@@ -5,7 +5,7 @@ import { errorPrefix, validateArgCount, validateCallback, validateContextObject,
5
5
  import { Logger } from '@firebase/logger';
6
6
 
7
7
  const name = "@firebase/database-compat";
8
- const version = "1.0.6-canary.9cd3c1eca";
8
+ const version = "1.0.6-canary.b284467c1";
9
9
 
10
10
  /**
11
11
  * @license
@@ -6,7 +6,7 @@ import { __extends } from 'tslib';
6
6
  import { Logger } from '@firebase/logger';
7
7
 
8
8
  var name = "@firebase/database-compat";
9
- var version = "1.0.6-canary.9cd3c1eca";
9
+ var version = "1.0.6-canary.b284467c1";
10
10
 
11
11
  /**
12
12
  * @license
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
13
13
 
14
14
  var name = "@firebase/database-compat";
15
- var version = "1.0.6-canary.9cd3c1eca";
15
+ var version = "1.0.6-canary.b284467c1";
16
16
 
17
17
  /**
18
18
  * @license
@@ -3954,7 +3954,7 @@ var isWindowsStoreApp = function () {
3954
3954
  return typeof Windows === 'object' && typeof Windows.UI === 'object';
3955
3955
  };
3956
3956
  /**
3957
- * Converts a server error code to a Javascript Error
3957
+ * Converts a server error code to a JavaScript Error
3958
3958
  */
3959
3959
  function errorForServerCode(code, query) {
3960
3960
  var reason = 'Unknown Error';
@@ -3983,7 +3983,7 @@ var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
3983
3983
  */
3984
3984
  var INTEGER_32_MIN = -2147483648;
3985
3985
  /**
3986
- * For use in kyes, the maximum possible 32-bit integer.
3986
+ * For use in keys, the maximum possible 32-bit integer.
3987
3987
  */
3988
3988
  var INTEGER_32_MAX = 2147483647;
3989
3989
  /**
@@ -4681,7 +4681,7 @@ var AppCheckTokenProvider = /** @class */ (function () {
4681
4681
  // Support delayed initialization of FirebaseAppCheck. This allows our
4682
4682
  // customers to initialize the RTDB SDK before initializing Firebase
4683
4683
  // AppCheck and ensures that all requests are authenticated if a token
4684
- // becomes available before the timoeout below expires.
4684
+ // becomes available before the timeout below expires.
4685
4685
  setTimeout(function () {
4686
4686
  if (_this.appCheck) {
4687
4687
  _this.getToken(forceRefresh).then(resolve, reject);
@@ -4743,7 +4743,7 @@ var FirebaseAuthTokenProvider = /** @class */ (function () {
4743
4743
  // Support delayed initialization of FirebaseAuth. This allows our
4744
4744
  // customers to initialize the RTDB SDK before initializing Firebase
4745
4745
  // Auth and ensures that all requests are authenticated if a token
4746
- // becomes available before the timoeout below expires.
4746
+ // becomes available before the timeout below expires.
4747
4747
  setTimeout(function () {
4748
4748
  if (_this.auth_) {
4749
4749
  _this.getToken(forceRefresh).then(resolve, reject);
@@ -5237,7 +5237,7 @@ var BrowserPollConnection = /** @class */ (function () {
5237
5237
  *********************************************************************************************/
5238
5238
  var FirebaseIFrameScriptHolder = /** @class */ (function () {
5239
5239
  /**
5240
- * @param commandCB - The callback to be called when control commands are recevied from the server.
5240
+ * @param commandCB - The callback to be called when control commands are received from the server.
5241
5241
  * @param onMessageCB - The callback to be triggered when responses arrive from the server.
5242
5242
  * @param onDisconnect - The callback to be triggered when this tag holder is closed
5243
5243
  * @param urlFn - A function that provides the URL of the endpoint to send data to.
@@ -5282,6 +5282,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
5282
5282
  var iframeContents = '<html><body>' + script + '</body></html>';
5283
5283
  try {
5284
5284
  this.myIFrame.doc.open();
5285
+ // TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
5286
+ // library to sanitize the HTML in the iframeContents.
5285
5287
  this.myIFrame.doc.write(iframeContents);
5286
5288
  this.myIFrame.doc.close();
5287
5289
  }
@@ -5507,6 +5509,10 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
5507
5509
  var newScript_1 = _this.myIFrame.doc.createElement('script');
5508
5510
  newScript_1.type = 'text/javascript';
5509
5511
  newScript_1.async = true;
5512
+ // TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
5513
+ // at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
5514
+ // assign a sanitized trustedResourceURL to it. Since the URL must be a template string
5515
+ // literal, this could require some heavy refactoring.
5510
5516
  newScript_1.src = url;
5511
5517
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5512
5518
  newScript_1.onload = newScript_1.onreadystatechange =
@@ -13997,7 +14003,7 @@ function treeHasChildren(tree) {
13997
14003
  return tree.node.childCount > 0;
13998
14004
  }
13999
14005
  /**
14000
- * @returns Whethe rthe tree is empty (no value or children).
14006
+ * @returns Whether the tree is empty (no value or children).
14001
14007
  */
14002
14008
  function treeIsEmpty(tree) {
14003
14009
  return treeGetValue(tree) === undefined && !treeHasChildren(tree);
@@ -16408,7 +16414,7 @@ function push(parent, value) {
16408
16414
  // then() and catch() methods and is used as the return value of push(). The
16409
16415
  // second remains a regular Reference and is used as the fulfilled value of
16410
16416
  // the first ThennableReference.
16411
- var thennablePushRef = child(parent, name);
16417
+ var thenablePushRef = child(parent, name);
16412
16418
  var pushRef = child(parent, name);
16413
16419
  var promise;
16414
16420
  if (value != null) {
@@ -16417,9 +16423,9 @@ function push(parent, value) {
16417
16423
  else {
16418
16424
  promise = Promise.resolve(pushRef);
16419
16425
  }
16420
- thennablePushRef.then = promise.then.bind(promise);
16421
- thennablePushRef.catch = promise.then.bind(promise, undefined);
16422
- return thennablePushRef;
16426
+ thenablePushRef.then = promise.then.bind(promise);
16427
+ thenablePushRef.catch = promise.then.bind(promise, undefined);
16428
+ return thenablePushRef;
16423
16429
  }
16424
16430
  /**
16425
16431
  * Removes the data at this Database location.