Browse Source

Early returns :heart:

Kevin van Zonneveld 9 years ago
parent
commit
5bf0f1d471
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/core/Core.js

+ 4 - 3
src/core/Core.js

@@ -71,10 +71,11 @@ export default class Core {
  * @return {String|Object} to log
  */
   log (msg) {
-    if (this.opts.debug) {
-      msg = JSON.stringify(msg)
-      console.log(`DEBUG LOG: ${msg}`)
+    if (!this.opts.debug) {
+      return
     }
+    msg = JSON.stringify(msg)
+    console.log(`DEBUG LOG: ${msg}`)
   }
 
 /**