Skip to content

Commit cb4d943

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent f6fcf77 commit cb4d943

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

packages/database/index.node.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import * as types from '@firebase/database-types';
3030
import { setSDKVersion } from './src/core/version';
3131
import { CONSTANTS } from '@firebase/util';
3232

33-
3433
const ServerValue = Database.ServerValue;
3534

3635
/**
@@ -41,11 +40,7 @@ const ServerValue = Database.ServerValue;
4140
* @param url A valid Firebase databaseURL
4241
* @param version custom version e.g. firebase-admin version
4342
*/
44-
export function initStandalone(
45-
app: FirebaseApp,
46-
url: string,
47-
version: string
48-
) {
43+
export function initStandalone(app: FirebaseApp, url: string, version: string) {
4944
/**
5045
* This should allow the firebase-admin package to provide a custom version
5146
* to the backend
@@ -69,7 +64,6 @@ export function initStandalone(
6964
}
7065

7166
export function registerDatabase(instance: FirebaseNamespace) {
72-
7367
// set SDK_VERSION
7468
setSDKVersion(instance.SDK_VERSION);
7569

@@ -96,17 +90,16 @@ export function registerDatabase(instance: FirebaseNamespace) {
9690
try {
9791
// If @firebase/app is not present, skip registering database.
9892
// It could happen when this package is used in firebase-admin which doesn't depend on @firebase/app.
99-
// Previously firebase-admin depends on @firebase/app, which causes version conflict on
93+
// Previously firebase-admin depends on @firebase/app, which causes version conflict on
10094
// @firebase/app when used together with the js sdk. More detail:
10195
// https://github.com/firebase/firebase-js-sdk/issues/1696#issuecomment-501546596
10296
const firebase = require('@firebase/app').default;
10397
registerDatabase(firebase);
104-
} catch(err) {
98+
} catch (err) {
10599
// catch 'MODULE_NOT_FOUND' error in firebase-admin
106100
// we can safely ignore this error because RTDB in firebase-admin works without @firebase/app
107101
}
108102

109-
110103
// Types to export for the admin SDK
111104
export { Database, Query, Reference, enableLogging, ServerValue };
112105

packages/database/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ import { setSDKVersion } from './src/core/version';
3333
const ServerValue = Database.ServerValue;
3434

3535
export function registerDatabase(instance: FirebaseNamespace) {
36-
3736
// set SDK_VERSION
3837
setSDKVersion(instance.SDK_VERSION);
39-
38+
4039
// Register the Database Service with the 'firebase' namespace.
4140
const namespace = (instance as _FirebaseNamespace).INTERNAL.registerService(
4241
'database',

packages/database/src/core/PersistentConnection.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { forEach, contains, isEmpty, getCount, safeGet, CONSTANTS } from '@firebase/util';
18+
import {
19+
forEach,
20+
contains,
21+
isEmpty,
22+
getCount,
23+
safeGet,
24+
CONSTANTS
25+
} from '@firebase/util';
1926
import { stringify } from '@firebase/util';
2027
import { assert } from '@firebase/util';
2128
import { error, log, logWrapper, warn, ObjectToUniqueKey } from './util/util';
@@ -985,9 +992,7 @@ export class PersistentConnection extends ServerActions {
985992
clientName = 'node';
986993
}
987994

988-
stats[
989-
'sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')
990-
] = 1;
995+
stats['sdk.' + clientName + '.' + SDK_VERSION.replace(/\./g, '-')] = 1;
991996

992997
if (isMobileCordova()) {
993998
stats['framework.cordova'] = 1;

packages/database/src/core/version.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
/** The semver (www.semver.org) version of the SDK. */
32
export let SDK_VERSION = '';
43

54
// SDK_VERSION should be set before any database instance is created
65
export function setSDKVersion(version: string): void {
7-
SDK_VERSION = version;
6+
SDK_VERSION = version;
87
}

packages/database/src/realtime/WebSocketConnection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ export class WebSocketConnection implements Transport {
149149
// UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
150150
const options: { [k: string]: object } = {
151151
headers: {
152-
'User-Agent': `Firebase/${PROTOCOL_VERSION}/${
153-
SDK_VERSION
154-
}/${process.platform}/${device}`
152+
'User-Agent': `Firebase/${PROTOCOL_VERSION}/${SDK_VERSION}/${
153+
process.platform
154+
}/${device}`
155155
}
156156
};
157157

0 commit comments

Comments
 (0)