Skip to content

Commit

Permalink
Removing straggler logical NOT operators
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Sep 11, 2017
1 parent 4c9a68d commit d9be23f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Tenso {
}

canETag (pathname, method, header) {
return regex.get_only.test(method) && (header !== void 0 ? this.etags.valid({"cache-control": header}) : true) && !this.config.etags.invalid.filter(i => i.test(pathname)).length;
return regex.get_only.test(method) && (header !== void 0 ? this.etags.valid({"cache-control": header}) : true) && this.config.etags.invalid.filter(i => i.test(pathname)).length === 0;
}

clf (req, res, headers) {
Expand Down Expand Up @@ -152,7 +152,7 @@ class Tenso {

error (req, res, err, headers = {}) {
const preset = res.statusCode >= 400,
numeric = !isNaN(err.message),
numeric = isNaN(err.message) === false,
status = preset ? res.statusCode : numeric ? Number(err.message) : 500;

return res.send(preset ? err : new Error(http.STATUS_CODES[status]), status, headers);
Expand Down Expand Up @@ -329,7 +329,7 @@ class Tenso {
}

redirect (req, res, uri, perm = false) {
return this.send(req, res, "", !perm ? 302 : 301, {location: uri});
return this.send(req, res, "", perm === false ? 302 : 301, {location: uri});
}

render (req, res, arg, headers) {
Expand Down Expand Up @@ -405,7 +405,7 @@ class Tenso {
send (req, res, body = "", status = 200, headers = {"content-type": "text/plain"}) {
const defer = deferred(),
head = regex.head.test(req.method),
pipe = !head && typeof body.on === "function",
pipe = head === false && typeof body.on === "function",
rheaders = res.getHeaders();
let indent = this.config.json,
compression = "",
Expand Down Expand Up @@ -522,7 +522,7 @@ class Tenso {

serialize (req, arg, status = 200, iot = false) {
let format = "application/json",
accepts = !iot ? utility.explode(req.parsed.query.format || req.headers.accept || format, ",") : format,
accepts = iot === false ? utility.explode(req.parsed.query.format || req.headers.accept || format, ",") : format,
errz = arg instanceof Error,
result, serializer;

Expand Down

0 comments on commit d9be23f

Please sign in to comment.