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(
5454 let url = base ;
5555
5656 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
5861 . filter ( ( k ) => {
5962 if ( k !== "scopes" ) return true ;
6063 if ( options . clientType === "github-app" ) return false ;
6164
6265 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
6469 // @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
6673 . forEach ( ( [ key , value ] , index ) => {
67- // Finally, build the URL
6874 url += index === 0 ? `?` : "&" ;
6975 url += `${ key } =${ value } ` ;
7076 } ) ;
You can’t perform that action at this time.
0 commit comments