@firebase/database 1.0.19 → 1.0.20-canary.25b60fdaa

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.
@@ -4,7 +4,7 @@ import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sh
4
4
  import { Logger, LogLevel } from '@firebase/logger';
5
5
 
6
6
  const name = "@firebase/database";
7
- const version = "1.0.19";
7
+ const version = "1.0.20-canary.25b60fdaa";
8
8
 
9
9
  /**
10
10
  * @license
@@ -717,9 +717,9 @@ class AppCheckTokenProvider {
717
717
  if (_isFirebaseServerApp(app) && app.settings.appCheckToken) {
718
718
  this.serverAppAppCheckToken = app.settings.appCheckToken;
719
719
  }
720
- this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true });
720
+ this.appCheck = appCheckProvider?.getImmediate({ optional: true });
721
721
  if (!this.appCheck) {
722
- appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck));
722
+ appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck));
723
723
  }
724
724
  }
725
725
  getToken(forceRefresh) {
@@ -748,8 +748,9 @@ class AppCheckTokenProvider {
748
748
  return this.appCheck.getToken(forceRefresh);
749
749
  }
750
750
  addTokenChangeListener(listener) {
751
- var _a;
752
- (_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener));
751
+ this.appCheckProvider
752
+ ?.get()
753
+ .then(appCheck => appCheck.addTokenListener(listener));
753
754
  }
754
755
  notifyForInvalidToken() {
755
756
  warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
@@ -2476,7 +2477,9 @@ class Connection {
2476
2477
  if (MESSAGE_DATA in controlData) {
2477
2478
  const payload = controlData[MESSAGE_DATA];
2478
2479
  if (cmd === SERVER_HELLO) {
2479
- const handshakePayload = Object.assign({}, payload);
2480
+ const handshakePayload = {
2481
+ ...payload
2482
+ };
2480
2483
  if (this.repoInfo_.isUsingEmulator) {
2481
2484
  // 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.
2482
2485
  handshakePayload.h = this.repoInfo_.host;
@@ -5292,9 +5295,9 @@ class IndexMap {
5292
5295
  newIndex = fallbackObject;
5293
5296
  }
5294
5297
  const indexName = indexDefinition.toString();
5295
- const newIndexSet = Object.assign({}, this.indexSet_);
5298
+ const newIndexSet = { ...this.indexSet_ };
5296
5299
  newIndexSet[indexName] = indexDefinition;
5297
- const newIndexes = Object.assign({}, this.indexes_);
5300
+ const newIndexes = { ...this.indexes_ };
5298
5301
  newIndexes[indexName] = newIndex;
5299
5302
  return new IndexMap(newIndexes, newIndexSet);
5300
5303
  }
@@ -7098,7 +7101,7 @@ class StatsListener {
7098
7101
  }
7099
7102
  get() {
7100
7103
  const newStats = this.collection_.get();
7101
- const delta = Object.assign({}, newStats);
7104
+ const delta = { ...newStats };
7102
7105
  if (this.last_) {
7103
7106
  each(this.last_, (stat, value) => {
7104
7107
  delta[stat] = delta[stat] - value;
@@ -13781,8 +13784,8 @@ function registerDatabase(variant) {
13781
13784
  return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url);
13782
13785
  }, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
13783
13786
  registerVersion(name, version, variant);
13784
- // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
13785
- registerVersion(name, version, 'esm2017');
13787
+ // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
13788
+ registerVersion(name, version, 'esm2020');
13786
13789
  }
13787
13790
 
13788
13791
  /**
@@ -13901,13 +13904,12 @@ class TransactionResult {
13901
13904
  function runTransaction(ref,
13902
13905
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13903
13906
  transactionUpdate, options) {
13904
- var _a;
13905
13907
  ref = getModularInstance(ref);
13906
13908
  validateWritablePath('Reference.transaction', ref._path);
13907
13909
  if (ref.key === '.length' || ref.key === '.keys') {
13908
13910
  throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
13909
13911
  }
13910
- const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true;
13912
+ const applyLocally = options?.applyLocally ?? true;
13911
13913
  const deferred = new Deferred();
13912
13914
  const promiseComplete = (error, committed, node) => {
13913
13915
  let dataSnapshot = null;
@@ -14027,4 +14029,4 @@ function _initStandalone({ app, url, version, customAuthImpl, customAppCheckImpl
14027
14029
  registerDatabase();
14028
14030
 
14029
14031
  export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, _initStandalone, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update };
14030
- //# sourceMappingURL=index.esm2017.js.map
14032
+ //# sourceMappingURL=index.esm.js.map