File tree 4 files changed +8
-9
lines changed
4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 29
29
"@firebase/app-types-exp" : " 0.x"
30
30
},
31
31
"dependencies" : {
32
- "@firebase/app" : " ^0.6.1" ,
33
32
"@firebase/util" : " ^0.2.44" ,
34
33
"tslib" : " 1.11.1"
35
34
},
Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ export function getBrowserName(userAgent: string): BrowserName | string {
74
74
return BrowserName . ANDROID ;
75
75
} else {
76
76
// 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 - z A - Z \d \ .] + ) \ /[ a - z A - Z \d \ .] * $ / ;
78
78
const matches = userAgent . match ( re ) ;
79
- if ( matches && matches . length === 2 ) {
79
+ if ( matches ? .length === 2 ) {
80
80
return matches [ 1 ] ;
81
81
}
82
82
}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import firebase from '@firebase/app' ;
18
+ import { SDK_VERSION } from '@firebase/app-exp ' ;
19
19
import { expect } from 'chai' ;
20
20
import { ClientPlatform , getClientVersion } from './version' ;
21
21
22
22
describe ( 'getClientVersion' , ( ) => {
23
23
context ( 'browser' , ( ) => {
24
24
it ( 'should set the correct version' , ( ) => {
25
25
expect ( getClientVersion ( ClientPlatform . BROWSER ) ) . to . eq (
26
- `Chrome/JsCore/${ firebase . SDK_VERSION } /FirebaseCore-web`
26
+ `Chrome/JsCore/${ SDK_VERSION } /FirebaseCore-web`
27
27
) ;
28
28
} ) ;
29
29
} ) ;
30
30
31
31
context ( 'worker' , ( ) => {
32
32
it ( 'should set the correct version' , ( ) => {
33
33
expect ( getClientVersion ( ClientPlatform . WORKER ) ) . to . eq (
34
- `Chrome-Worker/JsCore/${ firebase . SDK_VERSION } /FirebaseCore-web`
34
+ `Chrome-Worker/JsCore/${ SDK_VERSION } /FirebaseCore-web`
35
35
) ;
36
36
} ) ;
37
37
} ) ;
38
38
39
39
context ( 'React Native' , ( ) => {
40
40
it ( 'should set the correct version' , ( ) => {
41
41
expect ( getClientVersion ( ClientPlatform . REACT_NATIVE ) ) . to . eq (
42
- `ReactNative/JsCore/${ firebase . SDK_VERSION } /FirebaseCore-web`
42
+ `ReactNative/JsCore/${ SDK_VERSION } /FirebaseCore-web`
43
43
) ;
44
44
} ) ;
45
45
} ) ;
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import firebase from '@firebase/app' ;
18
+ import { SDK_VERSION } from '@firebase/app-exp ' ;
19
19
import { getBrowserName } from './browser' ;
20
20
import { getUA } from '@firebase/util' ;
21
21
@@ -57,5 +57,5 @@ export function getClientVersion(clientPlatform: ClientPlatform): string {
57
57
default :
58
58
reportedPlatform = clientPlatform ;
59
59
}
60
- return `${ reportedPlatform } /${ CLIENT_IMPLEMENTATION } /${ firebase . SDK_VERSION } /${ ClientFramework . DEFAULT } ` ;
60
+ return `${ reportedPlatform } /${ CLIENT_IMPLEMENTATION } /${ SDK_VERSION } /${ ClientFramework . DEFAULT } ` ;
61
61
}
You can’t perform that action at this time.
0 commit comments