@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.
@@ -1252,7 +1252,7 @@ WebSocketConnection.responsesRequiredToBeHealthy = 2;
1252
1252
  WebSocketConnection.healthyTimeout = 30000;
1253
1253
 
1254
1254
  const name = "@firebase/database";
1255
- const version = "1.0.20-canary.2b5731292";
1255
+ const version = "1.0.20-canary.cb19688bf";
1256
1256
 
1257
1257
  /**
1258
1258
  * @license
@@ -1280,9 +1280,9 @@ class AppCheckTokenProvider {
1280
1280
  if (_isFirebaseServerApp(app) && app.settings.appCheckToken) {
1281
1281
  this.serverAppAppCheckToken = app.settings.appCheckToken;
1282
1282
  }
1283
- this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true });
1283
+ this.appCheck = appCheckProvider?.getImmediate({ optional: true });
1284
1284
  if (!this.appCheck) {
1285
- appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck));
1285
+ appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck));
1286
1286
  }
1287
1287
  }
1288
1288
  getToken(forceRefresh) {
@@ -1311,8 +1311,9 @@ class AppCheckTokenProvider {
1311
1311
  return this.appCheck.getToken(forceRefresh);
1312
1312
  }
1313
1313
  addTokenChangeListener(listener) {
1314
- var _a;
1315
- (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener));
1314
+ this.appCheckProvider
1315
+ ?.get()
1316
+ .then(appCheck => appCheck.addTokenListener(listener));
1316
1317
  }
1317
1318
  notifyForInvalidToken() {
1318
1319
  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
  registerVersion(name, version, variant);
13788
- // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
13789
- registerVersion(name, version, 'esm2017');
13791
+ // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
13792
+ registerVersion(name, version, 'esm2020');
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 = 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 Deferred();
13916
13918
  const promiseComplete = (error, committed, node) => {
13917
13919
  let dataSnapshot = null;