Skip to content

Commit 343b1f4

Browse files
committed
m
1 parent b7146d5 commit 343b1f4

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed
16 KB
Binary file not shown.
Binary file not shown.

packages/database/src/core/util/libs/parser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -166,7 +166,7 @@ export const parseDatabaseURL = function(
166166
);
167167

168168
// If we have a port, use scheme for determining if it's secure.
169-
const colonInd = host.indexOf(':');
169+
colonInd = host.indexOf(':');
170170
if (colonInd >= 0) {
171171
secure = scheme === 'https' || scheme === 'wss';
172172
port = parseInt(host.substring(colonInd + 1), 10);
@@ -177,12 +177,12 @@ export const parseDatabaseURL = function(
177177
if (host.slice(0, colonInd).toLowerCase() === 'localhost') {
178178
domain = 'localhost';
179179
} else {
180-
let dotInd = host.indexOf('.');
180+
const dotInd = host.indexOf('.');
181181
if (dotInd === -1) {
182182
return; // Not a valid URL.
183183
}
184184
const hostFirstPart = host.substring(0, dotInd);
185-
domain = host.substring(dotInd+1);
185+
domain = host.substring(dotInd + 1);
186186
// Normalize namespaces to lowercase to share storage / connection.
187187
subdomain = hostFirstPart.toLowerCase();
188188
namespace = subdomain;
20 KB
Binary file not shown.

packages/database/test/database.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -66,7 +66,9 @@ describe('Database Tests', () => {
6666
const db = defaultApp.database('http://foo.euw1.firebasedatabase.app');
6767
expect(db).to.be.ok;
6868
expect(db.repo_.repoInfo_.namespace).to.equal('foo');
69-
expect(db.ref().toString()).to.equal('https://foo.euw1.firebasedatabase.app/');
69+
expect(db.ref().toString()).to.equal(
70+
'https://foo.euw1.firebasedatabase.app/'
71+
);
7072
});
7173

7274
it('Can get database with localhost URL and port', () => {

0 commit comments

Comments
 (0)