@@ -9,7 +9,7 @@ export const faraday: Client = {
99 link : 'https://github.com/lostisland/faraday' ,
1010 description : 'Faraday HTTP client' ,
1111 } ,
12- convert : ( { uriObj, queryObj, method : rawMethod , fullUrl , postData, allHeaders } , options = { } ) => {
12+ convert : ( { uriObj, queryObj, method : rawMethod , postData, allHeaders } ) => {
1313 const { push, blank, join } = new CodeBuilder ( ) ;
1414
1515 // To support custom methods we check for the supported methods
@@ -30,16 +30,16 @@ export const faraday: Client = {
3030 'TRACE' ,
3131 ] ;
3232
33- if ( ! methods . includes ( method ) ) {
34- push ( `# Faraday cannot currently run ${ method } requests. Please use another client.` )
33+ if ( ! methods . includes ( method ) ) {
34+ push ( `# Faraday cannot currently run ${ method } requests. Please use another client.` ) ;
3535 return join ( ) ;
3636 }
3737
3838 push ( "require 'faraday'" ) ;
3939 blank ( ) ;
4040
4141 // Write body to beginning of script
42- if ( postData . mimeType === 'application/x-www-form-urlencoded' ) {
42+ if ( postData . mimeType === 'application/x-www-form-urlencoded' ) {
4343 if ( postData . params ) {
4444 push ( `data = {` ) ;
4545 postData . params . forEach ( param => {
@@ -52,8 +52,12 @@ export const faraday: Client = {
5252
5353 push ( `conn = Faraday.new(` ) ;
5454 push ( ` url: '${ uriObj . protocol } //${ uriObj . host } ',` ) ;
55- if ( allHeaders [ 'content-type' ] || allHeaders [ 'Content-Type' ] ) {
56- push ( ` headers: {'Content-Type' => '${ allHeaders [ 'content-type' ] || allHeaders [ 'Content-Type' ] } '}` ) ;
55+ if ( allHeaders [ 'content-type' ] || allHeaders [ 'Content-Type' ] ) {
56+ push (
57+ ` headers: {'Content-Type' => '${
58+ allHeaders [ 'content-type' ] || allHeaders [ 'Content-Type' ]
59+ } '}`,
60+ ) ;
5761 }
5862 push ( `)` ) ;
5963
@@ -63,7 +67,7 @@ export const faraday: Client = {
6367 const headers = Object . keys ( allHeaders ) ;
6468 if ( headers . length ) {
6569 headers . forEach ( key => {
66- if ( key . toLowerCase ( ) !== 'content-type' ) {
70+ if ( key . toLowerCase ( ) !== 'content-type' ) {
6771 push ( ` req.headers['${ key } '] = '${ escapeForSingleQuotes ( allHeaders [ key ] ) } '` ) ;
6872 }
6973 } ) ;
@@ -72,9 +76,9 @@ export const faraday: Client = {
7276 Object . keys ( queryObj ) . forEach ( name => {
7377 const value = queryObj [ name ] ;
7478 if ( Array . isArray ( value ) ) {
75- push ( ` req.params['${ name } '] = ${ JSON . stringify ( value ) } ` )
79+ push ( ` req.params['${ name } '] = ${ JSON . stringify ( value ) } ` ) ;
7680 } else {
77- push ( ` req.params['${ name } '] = '${ value } '` )
81+ push ( ` req.params['${ name } '] = '${ value } '` ) ;
7882 }
7983 } ) ;
8084
@@ -98,7 +102,7 @@ export const faraday: Client = {
98102 }
99103
100104 push ( 'end' ) ;
101- blank ( )
105+ blank ( ) ;
102106 push ( 'puts response.status' ) ;
103107 push ( 'puts response.body' ) ;
104108
0 commit comments