@firebase/database 1.0.20-canary.2b5731292 → 1.0.20-canary.cb19688bf

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
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
8
8
  var logger$1 = require('@firebase/logger');
9
9
 
10
10
  const name = "@firebase/database";
11
- const version = "1.0.20-canary.2b5731292";
11
+ const version = "1.0.20-canary.cb19688bf";
12
12
 
13
13
  /**
14
14
  * @license
@@ -721,9 +721,9 @@ class AppCheckTokenProvider {
721
721
  if (app._isFirebaseServerApp(app$1) && app$1.settings.appCheckToken) {
722
722
  this.serverAppAppCheckToken = app$1.settings.appCheckToken;
723
723
  }
724
- this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true });
724
+ this.appCheck = appCheckProvider?.getImmediate({ optional: true });
725
725
  if (!this.appCheck) {
726
- appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck));
726
+ appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck));
727
727
  }
728
728
  }
729
729
  getToken(forceRefresh) {
@@ -752,8 +752,9 @@ class AppCheckTokenProvider {
752
752
  return this.appCheck.getToken(forceRefresh);
753
753
  }
754
754
  addTokenChangeListener(listener) {
755
- var _a;
756
- (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener));
755
+ this.appCheckProvider
756
+ ?.get()
757
+ .then(appCheck => appCheck.addTokenListener(listener));
757
758
  }
758
759
  notifyForInvalidToken() {
759
760
  warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
@@ -2480,7 +2481,9 @@ class Connection {
2480
2481
  if (MESSAGE_DATA in controlData) {
2481
2482
  const payload = controlData[MESSAGE_DATA];
2482
2483
  if (cmd === SERVER_HELLO) {
2483
- const handshakePayload = Object.assign({}, payload);
2484
+ const handshakePayload = {
2485
+ ...payload
2486
+ };
2484
2487
  if (this.repoInfo_.isUsingEmulator) {
2485
2488
  // Upon connecting, the emulator will pass the hostname that it's aware of, but we prefer the user's set hostname via `connectDatabaseEmulator` over what the emulator passes.
2486
2489
  handshakePayload.h = this.repoInfo_.host;
@@ -5296,9 +5299,9 @@ class IndexMap {
5296
5299
  newIndex = fallbackObject;
5297
5300
  }
5298
5301
  const indexName = indexDefinition.toString();
5299
- const newIndexSet = Object.assign({}, this.indexSet_);
5302
+ const newIndexSet = { ...this.indexSet_ };
5300
5303
  newIndexSet[indexName] = indexDefinition;
5301
- const newIndexes = Object.assign({}, this.indexes_);
5304
+ const newIndexes = { ...this.indexes_ };
5302
5305
  newIndexes[indexName] = newIndex;
5303
5306
  return new IndexMap(newIndexes, newIndexSet);
5304
5307
  }
@@ -7102,7 +7105,7 @@ class StatsListener {
7102
7105
  }
7103
7106
  get() {
7104
7107
  const newStats = this.collection_.get();
7105
- const delta = Object.assign({}, newStats);
7108
+ const delta = { ...newStats };
7106
7109
  if (this.last_) {
7107
7110
  each(this.last_, (stat, value) => {
7108
7111
  delta[stat] = delta[stat] - value;
@@ -13785,8 +13788,8 @@ function registerDatabase(variant) {
13785
13788
  return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url);
13786
13789
  }, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
13787
13790
  app.registerVersion(name, version, variant);
13788
- // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
13789
- app.registerVersion(name, version, 'cjs2017');
13791
+ // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
13792
+ app.registerVersion(name, version, 'cjs2020');
13790
13793
  }
13791
13794
 
13792
13795
  /**
@@ -13905,13 +13908,12 @@ class TransactionResult {
13905
13908
  function runTransaction(ref,
13906
13909
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13907
13910
  transactionUpdate, options) {
13908
- var _a;
13909
13911
  ref = util.getModularInstance(ref);
13910
13912
  validateWritablePath('Reference.transaction', ref._path);
13911
13913
  if (ref.key === '.length' || ref.key === '.keys') {
13912
13914
  throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
13913
13915
  }
13914
- const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true;
13916
+ const applyLocally = options?.applyLocally ?? true;
13915
13917
  const deferred = new util.Deferred();
13916
13918
  const promiseComplete = (error, committed, node) => {
13917
13919
  let dataSnapshot = null;