@@ -35,7 +35,7 @@ enum QueryField {
35
35
/**
36
36
* Map from mode string in action code URL to Action Code Info operation.
37
37
*/
38
- const _ModeToOperationMap : { [ key : string ] : Operation } = {
38
+ const ModeToOperationMap : { [ key : string ] : Operation } = {
39
39
'recoverEmail' : Operation . RECOVER_EMAIL ,
40
40
'resetPassword' : Operation . PASSWORD_RESET ,
41
41
'signIn' : Operation . EMAIL_SIGNIN ,
@@ -47,11 +47,11 @@ const _ModeToOperationMap: { [key: string]: Operation } = {
47
47
/**
48
48
* Maps the mode string in action code URL to Action Code Info operation.
49
49
*/
50
- function _parseMode ( mode : string | null ) : Operation | null {
51
- return mode ? _ModeToOperationMap [ mode ] || null : null ;
50
+ function parseMode ( mode : string | null ) : Operation | null {
51
+ return mode ? ModeToOperationMap [ mode ] || null : null ;
52
52
}
53
53
54
- function _parseDeepLink ( url : string ) : string {
54
+ function parseDeepLink ( url : string ) : string {
55
55
const uri = new URL ( url ) ;
56
56
const link = uri . searchParams . get ( 'link' ) ;
57
57
// Double link case (automatic redirect).
@@ -76,7 +76,7 @@ export class ActionCodeURL {
76
76
const uri = new URL ( actionLink ) ;
77
77
const apiKey = uri . searchParams . get ( QueryField . API_KEY ) ;
78
78
const code = uri . searchParams . get ( QueryField . CODE ) ;
79
- const operation = _parseMode ( uri . searchParams . get ( QueryField . MODE ) ) ;
79
+ const operation = parseMode ( uri . searchParams . get ( QueryField . MODE ) ) ;
80
80
// Validate API key, code and mode.
81
81
if ( ! apiKey || ! code || ! operation ) {
82
82
throw AUTH_ERROR_FACTORY . create ( AuthErrorCode . ARGUMENT_ERROR , {
@@ -89,14 +89,13 @@ export class ActionCodeURL {
89
89
this . continueUrl = uri . searchParams . get ( QueryField . CONTINUE_URL ) ;
90
90
this . languageCode = uri . searchParams . get ( QueryField . LANGUAGE_CODE ) ;
91
91
this . tenantId = uri . searchParams . get ( QueryField . TENANT_ID ) ;
92
- return this ;
93
92
}
94
93
95
94
static _fromLink ( auth : Auth , link : string ) : ActionCodeURL | null {
96
- const actionLink = _parseDeepLink ( link ) ;
95
+ const actionLink = parseDeepLink ( link ) ;
97
96
try {
98
97
return new ActionCodeURL ( auth , actionLink ) ;
99
- } catch ( e ) {
98
+ } catch {
100
99
return null ;
101
100
}
102
101
}
0 commit comments