Skip to content

Commit eb5ba86

Browse files
authored
Merge pull request #112 from ConsenSys/dont-send-debug
Don't send 'debug' in options
2 parents f2eb519 + 9887cd5 commit eb5ba86

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Client {
6767
* database using getIssues().
6868
*
6969
**/
70-
async analyze (options, timeout, initialDelay) {
70+
async analyze (options, timeout, initialDelay, debug) {
7171
if (options === undefined || options.data === undefined) {
7272
// eslint-disable-next-line no-throw-literal
7373
throw 'Please provide analysis request JSON in a "data" attribute.'
@@ -115,22 +115,22 @@ class Client {
115115
)
116116
}
117117

118-
if (options.debug) {
118+
if (debug) {
119119
console.log(`now: ${Math.trunc(Date.now() / 1000)}`)
120120
}
121121

122122
let result
123123
if (requestResponse.status === 'Finished') {
124124
result = await analysisPoller.getIssues(requestResponse.uuid, this)
125-
if (options.debug) {
125+
if (debug) {
126126
const util = require('util')
127-
let depth = (options.debug > 1) ? 10 : 2
127+
let depth = (debug > 1) ? 10 : 2
128128
console.log(`Cached Result:\n${util.inspect(result, { depth: depth })}\n------`)
129129
}
130130
} else {
131131
initialDelay = Math.max(initialDelay || 0, defaultInitialDelay)
132132
try {
133-
result = await analysisPoller.do(requestResponse.uuid, this, timeout, initialDelay, options.debug)
133+
result = await analysisPoller.do(requestResponse.uuid, this, timeout, initialDelay, debug)
134134
} catch (e) {
135135
/*
136136
Normally requester passes back strings. However there is a spcial case for
@@ -143,7 +143,7 @@ class Client {
143143
this.accessToken = tokens.access
144144
this.refreshToken = tokens.refresh
145145
result = await analysisPoller.do(requestResponse.uuid, this, timeout,
146-
initialDelay, options.debug)
146+
initialDelay, debug)
147147
}
148148
}
149149

0 commit comments

Comments
 (0)