Skip to content

Commit e4323bd

Browse files
committed
PR feedback
1 parent 52652d2 commit e4323bd

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

packages-exp/auth-exp/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@firebase/app-types-exp": "0.x"
3030
},
3131
"dependencies": {
32-
"@firebase/app": "^0.6.1",
3332
"@firebase/util": "^0.2.44",
3433
"tslib": "1.11.1"
3534
},

packages-exp/auth-exp/src/core/util/browser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export function getBrowserName(userAgent: string): BrowserName | string {
7474
return BrowserName.ANDROID;
7575
} else {
7676
// Most modern browsers have name/version at end of user agent string.
77-
const re = new RegExp('([a-zA-Z\\d\\.]+)/[a-zA-Z\\d\\.]*$');
77+
const re = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/;
7878
const matches = userAgent.match(re);
79-
if (matches && matches.length === 2) {
79+
if (matches?.length === 2) {
8080
return matches[1];
8181
}
8282
}

packages-exp/auth-exp/src/core/util/version.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@
1515
* limitations under the License.
1616
*/
1717

18-
import firebase from '@firebase/app';
18+
import { SDK_VERSION } from '@firebase/app-exp';
1919
import { expect } from 'chai';
2020
import { ClientPlatform, getClientVersion } from './version';
2121

2222
describe('getClientVersion', () => {
2323
context('browser', () => {
2424
it('should set the correct version', () => {
2525
expect(getClientVersion(ClientPlatform.BROWSER)).to.eq(
26-
`Chrome/JsCore/${firebase.SDK_VERSION}/FirebaseCore-web`
26+
`Chrome/JsCore/${SDK_VERSION}/FirebaseCore-web`
2727
);
2828
});
2929
});
3030

3131
context('worker', () => {
3232
it('should set the correct version', () => {
3333
expect(getClientVersion(ClientPlatform.WORKER)).to.eq(
34-
`Chrome-Worker/JsCore/${firebase.SDK_VERSION}/FirebaseCore-web`
34+
`Chrome-Worker/JsCore/${SDK_VERSION}/FirebaseCore-web`
3535
);
3636
});
3737
});
3838

3939
context('React Native', () => {
4040
it('should set the correct version', () => {
4141
expect(getClientVersion(ClientPlatform.REACT_NATIVE)).to.eq(
42-
`ReactNative/JsCore/${firebase.SDK_VERSION}/FirebaseCore-web`
42+
`ReactNative/JsCore/${SDK_VERSION}/FirebaseCore-web`
4343
);
4444
});
4545
});

packages-exp/auth-exp/src/core/util/version.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import firebase from '@firebase/app';
18+
import { SDK_VERSION } from '@firebase/app-exp';
1919
import { getBrowserName } from './browser';
2020
import { getUA } from '@firebase/util';
2121

@@ -57,5 +57,5 @@ export function getClientVersion(clientPlatform: ClientPlatform): string {
5757
default:
5858
reportedPlatform = clientPlatform;
5959
}
60-
return `${reportedPlatform}/${CLIENT_IMPLEMENTATION}/${firebase.SDK_VERSION}/${ClientFramework.DEFAULT}`;
60+
return `${reportedPlatform}/${CLIENT_IMPLEMENTATION}/${SDK_VERSION}/${ClientFramework.DEFAULT}`;
6161
}

0 commit comments

Comments
 (0)