@@ -113,26 +113,6 @@ export function generateConfigs(configs: ConfigsOptions = {}): string {
113113 } ) ;
114114}
115115
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-
136116export function generateCodeChallenge ( ) : string {
137117 const codeVerifier = uuid ( ) ;
138118
@@ -154,3 +134,24 @@ export function generateSdkHeaderInfo(): {
154134export function openWindow ( url : string , windowName : string ) : Window | null {
155135 return window . open ( url , windowName , 'noreferrer' ) ;
156136}
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