@@ -15,8 +15,7 @@ const log_level = argv.log_level || 'error'
1515var client = new DataApiClient ( { log_level } )
1616
1717var doPost = function ( path , content ) {
18-
19- if ( ( typeof content ) != 'object' ) {
18+ if ( ( typeof content ) !== 'object' ) {
2019 content = JSON . parse ( content )
2120 }
2221
@@ -37,7 +36,7 @@ var doGet = function (path) {
3736 let formattedResponse = resp
3837 if ( typeof resp !== 'string' ) {
3938 // If JSON, format as json, otherwise print as-is:
40- try { Object . keys ( resp ) . length >= 1 && ( formattedResponse = JSON . stringify ( resp , null , 2 ) ) } catch ( e ) { }
39+ try { Object . keys ( resp ) . length >= 1 && ( formattedResponse = JSON . stringify ( resp , null , 2 ) ) } catch ( e ) { }
4140 }
4241 console . log ( 'Got response: \n' , formattedResponse )
4342 } ) . catch ( ( e ) => {
@@ -68,9 +67,8 @@ function promptToPost (path, content) {
6867
6968 try {
7069 // Assume all posted bodies are json
71- console . log ( " content: " , content )
70+ console . log ( ' content: ' , content )
7271 content = JSON . parse ( content )
73-
7472 } catch ( e ) {
7573 throw new Error ( 'Content to POST does not appear to be JSON. Only JSON supported currently.' )
7674 }
@@ -204,10 +202,9 @@ else if (command === 'help') {
204202 }
205203
206204 // Execute the command
207- exec = commandGroup . exec
205+ const exec = commandGroup . exec
208206 if ( exec ) exec . apply ( null , args )
209207 else help ( command )
210-
211208 } catch ( e ) {
212209 console . log ( 'Error thrown: ' , e )
213210
0 commit comments