@firebase/database 0.13.6 → 0.13.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Unreleased
2
2
 
3
+ ## 0.13.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4) [#6526](https://github.com/firebase/firebase-js-sdk/pull/6526) - Add functionality to auto-initialize project config and emulator settings from global defaults provided by framework tooling.
8
+
9
+ - Updated dependencies [[`fdd4ab464`](https://github.com/firebase/firebase-js-sdk/commit/fdd4ab464b59a107bdcc195df3f01e32efd89ed4)]:
10
+ - @firebase/util@1.7.0
11
+ - @firebase/component@0.5.18
12
+
3
13
  ## 0.13.6
4
14
 
5
15
  ### Patch Changes
@@ -1,10 +1,10 @@
1
1
  import { getApp, _getProvider, SDK_VERSION as SDK_VERSION$1, _registerComponent, registerVersion } from '@firebase/app';
2
2
  import { Component } from '@firebase/component';
3
- import { stringify, jsonEval, contains, assert, isNodeSdk, base64, stringToByteArray, Sha1, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, createMockUserToken } from '@firebase/util';
3
+ import { stringify, jsonEval, contains, assert, isNodeSdk, base64, stringToByteArray, Sha1, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHost, createMockUserToken } from '@firebase/util';
4
4
  import { Logger, LogLevel } from '@firebase/logger';
5
5
 
6
6
  const name = "@firebase/database";
7
- const version = "0.13.6";
7
+ const version = "0.13.7";
8
8
 
9
9
  /**
10
10
  * @license
@@ -13701,9 +13701,15 @@ function forceLongPolling() {
13701
13701
  * @returns The `Database` instance of the provided app.
13702
13702
  */
13703
13703
  function getDatabase(app = getApp(), url) {
13704
- return _getProvider(app, 'database').getImmediate({
13704
+ const db = _getProvider(app, 'database').getImmediate({
13705
13705
  identifier: url
13706
13706
  });
13707
+ const databaseEmulatorHost = getDefaultEmulatorHost('database');
13708
+ if (databaseEmulatorHost) {
13709
+ const [host, port] = databaseEmulatorHost.split(':');
13710
+ connectDatabaseEmulator(db, host, parseInt(port, 10));
13711
+ }
13712
+ return db;
13707
13713
  }
13708
13714
  /**
13709
13715
  * Modify the provided instance to communicate with the Realtime Database