File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,23 @@ function urlBuilderAuthorize(
54
54
let url = base ;
55
55
56
56
Object . keys ( map )
57
- . filter ( ( k ) => options [ k ] !== null ) // Filter out keys that are null and remove the url key
57
+ // Filter out keys that are null and remove the url key
58
+ . filter ( ( k ) => options [ k ] !== null )
59
+
60
+ // Filter out empty scopes array
58
61
. filter ( ( k ) => {
59
62
if ( k !== "scopes" ) return true ;
60
63
if ( options . clientType === "github-app" ) return false ;
61
64
62
65
return ! Array . isArray ( options [ k ] ) || ( options [ k ] as string [ ] ) . length > 1 ;
63
- } ) // Filter out empty scopes array
66
+ } )
67
+
68
+ // Map Array with the proper URL parameter names and change the value to a string using template strings
64
69
// @ts -ignore
65
- . map ( ( key ) => [ map [ key ] , `${ options [ key ] } ` ] ) // Map Array with the proper URL parameter names and change the value to a string using template strings
70
+ . map ( ( key ) => [ map [ key ] , `${ options [ key ] } ` ] )
71
+
72
+ // Finally, build the URL
66
73
. forEach ( ( [ key , value ] , index ) => {
67
- // Finally, build the URL
68
74
url += index === 0 ? `?` : "&" ;
69
75
url += `${ key } =${ value } ` ;
70
76
} ) ;
You can’t perform that action at this time.
0 commit comments