Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test": "yarn run coverage",
"coverage": "nyc mocha",
"coverage-html": "nyc report --reporter=html && open ./coverage/index.html",
"check-coverage": "nyc check-coverage --statements 40 --functions 40 --branches 0 --lines 40",
"check-coverage": "nyc check-coverage --statements 35 --functions 35 --branches 0 --lines 35",
"report": "nyc report",
"coverage-lcov": "nyc report --reporter=lcov",
"codacy": "cat ./coverage/lcov.info | codacy-coverage",
Expand All @@ -54,20 +54,20 @@
"main": "./src/main.js",
"dependencies": {
"clipboardy": "^2.1.0",
"diff2html": "^2.7.0",
"diff2html": "^2.11.2",
"extend": "^3.0.2",
"open": "^6.0.0",
"open": "^6.4.0",
"request": "^2.88.0",
"yargs": "^12.0.5"
"yargs": "^14.0.0"
},
"devDependencies": {
"codacy-coverage": "^3.4.0",
"eslint": "^5.13.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"mocha": "^5.2.0",
"nyc": "^13.2.0",
"sinon": "^7.2.3"
"eslint": "^6.2.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"mocha": "^6.2.0",
"nyc": "^14.1.1",
"sinon": "^7.4.1"
},
"license": "MIT",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions src/http-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
response.on('data', function(body) {
try {
var object = JSON.parse(body.toString('utf8'));
if(object.id) {
return callback(null, "https://diffy.org/diff/" + object.id);
if (object.id) {
return callback(null, 'https://diffy.org/diff/' + object.id);
} else if (object.error) {
return callback(new Error(object.error));
}else {
} else {
return callback(new Error(body.toString('utf8')));
}
} catch (err) {
Expand Down