Skip to content

Commit

Permalink
Merge pull request #10 from standard/standardizer-update
Browse files Browse the repository at this point in the history
update to use new response from standardizer api
  • Loading branch information
Flet authored May 5, 2022
2 parents 3c299aa + f0dfff2 commit c95f8f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ecstatic": "^4.1.4",
"standard": "*",
"tape": "^5.0.1",
"watchify": "^3.11.1"
"watchify": "^4.0.0"
},
"homepage": "https://github.com/flet/standard-demo",
"keywords": [],
Expand Down
8 changes: 4 additions & 4 deletions standardizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ module.exports = {
method: 'POST',
url: lint,
json: true,
body: { text: text },
body: { text },
headers
}
process(opts, function (err, resp) {
if (err) return cb(err)
return cb(null, resp.results[0].messages)
return cb(null, resp[0].messages)
})
},

Expand All @@ -53,12 +53,12 @@ module.exports = {
method: 'POST',
url: fix,
json: true,
body: { text: text },
body: { text },
headers
}
process(opts, function (err, resp) {
if (err) return cb(err)
const fixedText = resp.results[0].output || text
const fixedText = resp[0].output || text
return cb(null, fixedText)
})
}
Expand Down

0 comments on commit c95f8f7

Please sign in to comment.