Skip to content
Browse files

Clean up jslint errors

  • Loading branch information...
1 parent a925b36 commit 2b98ad290057a7eead5b48ed85792be9b1ff43bb @jeremiahshirk committed
Showing with 10 additions and 8 deletions.
  1. +3 −4 api/api.js
  2. +7 −4 api/util.js
View
7 api/api.js
@@ -61,7 +61,7 @@ function post(host, path, call_params, res_cb) {
function res_parser(callback) {
'use strict';
- var parser;
+ var parser, result;
// return a function that can be used as an HTTPS response callback
// which in turn calls the arg callback with the parsed JSON body
parser = function parser(response) {
@@ -71,7 +71,7 @@ function res_parser(callback) {
};
parse_body = function parse_body() {
try {
- var result = JSON.parse(body);
+ result = JSON.parse(body);
}
catch(err) {
result = err;
@@ -79,9 +79,8 @@ function res_parser(callback) {
if (result instanceof Error) {
console.log("Error parsing JSON: ", result, "\n", body , "\n");
return;
- } else {
- callback(result);
}
+ callback(result);
};
response.on('data', append_chunk);
response.on('end', parse_body);
View
11 api/util.js
@@ -1,7 +1,10 @@
+/*jslint node: true, indent: 2 */
+
function debug() {
- if (global.monitis.debug === true) {
- console.log(arguments);
- }
+ 'use strict';
+ if (global.monitis.debug === true) {
+ console.log(arguments);
+ }
}
-module.exports.debug = debug;
+module.exports.debug = debug;

0 comments on commit 2b98ad2

Please sign in to comment.
Something went wrong with that request. Please try again.