@@ -113,26 +113,6 @@ export function generateConfigs(configs: ConfigsOptions = {}): string {
113
113
} ) ;
114
114
}
115
115
116
- function isAuthnMethod ( x : unknown ) : x is AuthnMethod {
117
- return supportedAuthnMethod . includes ( x as AuthnMethod ) ;
118
- }
119
-
120
- function parseAuthnMethod ( x : unknown ) : AuthnMethod | undefined {
121
- if ( Array . isArray ( x ) ) {
122
- throw new TypeError ( 'Array is not allowed for authnMethod' ) ;
123
- }
124
-
125
- return isAuthnMethod ( x ) ? x : undefined ;
126
- }
127
-
128
- function isAuthAction ( x : unknown ) : x is AuthAction {
129
- return supportedAuthAction . includes ( x as AuthAction ) ;
130
- }
131
-
132
- function parseAuthAction ( x : unknown ) : AuthAction | undefined {
133
- return isAuthAction ( x ) ? x : undefined ;
134
- }
135
-
136
116
export function generateCodeChallenge ( ) : string {
137
117
const codeVerifier = uuid ( ) ;
138
118
@@ -154,3 +134,24 @@ export function generateSdkHeaderInfo(): {
154
134
export function openWindow ( url : string , windowName : string ) : Window | null {
155
135
return window . open ( url , windowName , 'noreferrer' ) ;
156
136
}
137
+
138
+ // Validators
139
+ function isAuthnMethod ( x : unknown ) : x is AuthnMethod {
140
+ return supportedAuthnMethod . includes ( x as AuthnMethod ) ;
141
+ }
142
+
143
+ function parseAuthnMethod ( x : unknown ) : AuthnMethod | undefined {
144
+ if ( Array . isArray ( x ) ) {
145
+ throw new TypeError ( 'Array is not allowed for authnMethod' ) ;
146
+ }
147
+
148
+ return isAuthnMethod ( x ) ? x : undefined ;
149
+ }
150
+
151
+ function isAuthAction ( x : unknown ) : x is AuthAction {
152
+ return supportedAuthAction . includes ( x as AuthAction ) ;
153
+ }
154
+
155
+ function parseAuthAction ( x : unknown ) : AuthAction | undefined {
156
+ return isAuthAction ( x ) ? x : undefined ;
157
+ }
0 commit comments