[Pkg-javascript-commits] [node-mocks-http] 290/296: updated to not use loose null checks

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository node-mocks-http.

commit 8632c0a6bce79f71403d62903c1b0e335a49778a
Author: Garrett Heaver <garrett at iterationfour.com>
Date:   Tue Jan 5 23:35:40 2016 +0000

    updated to not use loose null checks
---
 lib/mockRequest.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/mockRequest.js b/lib/mockRequest.js
index 5f51645..2ba2950 100644
--- a/lib/mockRequest.js
+++ b/lib/mockRequest.js
@@ -163,11 +163,11 @@ function createRequest(options) {
      *   - req.query
      */
     mockRequest.param = function(parameterName, defaultValue) {
-        if (null != mockRequest.params[parameterName]) {
+        if (mockRequest.params.hasOwnProperty(parameterName)) {
             return mockRequest.params[parameterName];
-        } else if (null != mockRequest.body[parameterName]) {
+        } else if (mockRequest.body.hasOwnProperty(parameterName)) {
             return mockRequest.body[parameterName];
-        } else if (null != mockRequest.query[parameterName]) {
+        } else if (mockRequest.query.hasOwnProperty(parameterName)) {
             return mockRequest.query[parameterName];
         }
         return defaultValue;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git



More information about the Pkg-javascript-commits mailing list