From 053209679147a278d38944c6a93d5d28328ebd35 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Mon, 6 Mar 2017 08:20:59 -0500 Subject: [PATCH] lint: remove unreachable code branches --- lib/read.js | 8 ++++---- lib/types/json.js | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/read.js b/lib/read.js index 3c0fe936..ca0d5bda 100644 --- a/lib/read.js +++ b/lib/read.js @@ -31,13 +31,13 @@ module.exports = read * @param {function} next * @param {function} parse * @param {function} debug - * @param {object} [options] - * @api private + * @param {object} options + * @private */ function read (req, res, next, parse, debug, options) { var length - var opts = options || {} + var opts = options var stream // flag as parsed @@ -45,7 +45,7 @@ function read (req, res, next, parse, debug, options) { // read options var encoding = opts.encoding !== null - ? opts.encoding || 'utf-8' + ? opts.encoding : null var verify = opts.verify diff --git a/lib/types/json.js b/lib/types/json.js index d0023c7b..469123a7 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -138,12 +138,11 @@ function json (options) { * * @param {string} str * @return {function} - * @api public + * @private */ function firstchar (str) { - var match = FIRST_CHAR_REGEXP.exec(str) - return match ? match[1] : '' + return FIRST_CHAR_REGEXP.exec(str)[1] } /**