Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[minor] Dont allow multi-line values for conditional returns

  • Loading branch information...
commit 3220dd9e5c9e6a98a2854ca30ec5e6dfce2d55ce 1 parent 94c6518
Charlie Robbins authored July 08, 2012

Showing 1 changed file with 10 additions and 8 deletions. Show diff stats Hide diff stats

  1. 18  lib/winston/common.js
18  lib/winston/common.js
@@ -134,6 +134,7 @@ exports.log = function (options) {
134 134
     if (typeof meta !== 'object' && meta != null) {
135 135
       meta = { meta: meta };
136 136
     }
  137
+
137 138
     output         = exports.clone(meta) || {};
138 139
     output.level   = options.level;
139 140
     output.message = options.message;
@@ -142,14 +143,15 @@ exports.log = function (options) {
142 143
       output.timestamp = timestamp;
143 144
     }
144 145
 
145  
-    return typeof options.stringify === 'function'
146  
-      ? options.stringify(output)
147  
-      : JSON.stringify(output, function (key, value) {
148  
-    	  if (value instanceof Buffer) {
149  
-	        return value.toString('base64');
150  
-	    }
151  
-	    return value;
152  
-      });
  146
+    if (typeof options.stringify === 'function') {
  147
+      return options.stringify(output);
  148
+    }
  149
+
  150
+    return JSON.stringify(output, function (key, value) {
  151
+      return value instanceof Buffer
  152
+        ? value.toString('base64')
  153
+        : value;
  154
+    });
153 155
   }
154 156
 
155 157
   output = timestamp ? timestamp + ' - ' : '';

0 notes on commit 3220dd9

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