Comparing version 1.0.0 to 1.0.1
24
index.js
@@ -8,3 +8,3 @@ const NodeCache = require( "node-cache" ); | ||
case: "none", | ||
function: "log", | ||
function: "letlog", | ||
color: "white", | ||
@@ -30,2 +30,3 @@ bgColor: "bgBlack", | ||
let variables = []; | ||
let clean_variables = []; | ||
let regex = new RegExp("^" + default_options.function + "\((.*)\)$", "gm"); | ||
@@ -41,3 +42,9 @@ | ||
if(values.varNames.length < variables.length){ | ||
for(varr of variables){ | ||
if(varr.indexOf("require(") == -1){ | ||
clean_variables.push(varr) | ||
} | ||
} | ||
if(values.varNames.length < clean_variables.length){ | ||
values.varNames.push({[variable]: values.varNames.length}) | ||
@@ -89,2 +96,3 @@ } | ||
let variables = []; | ||
let clean_variables = []; | ||
colors.setTheme({ | ||
@@ -106,2 +114,8 @@ custom: [default_options.color, default_options.bgColor, default_options.style] | ||
for(varr of variables){ | ||
if(varr.indexOf("require(") == -1){ | ||
clean_variables.push(varr) | ||
} | ||
} | ||
cache.get( filename, ( err, cacheData ) => { | ||
@@ -120,9 +134,9 @@ | ||
case 'upper': | ||
console.log((variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0].toUpperCase()+default_options.separator).custom+" "+variable); | ||
console.log((clean_variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0].toUpperCase()+default_options.separator).custom+" "+variable); | ||
break; | ||
case 'lower': | ||
console.log((variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0].toLowerCase()+default_options.separator).custom+" "+variable); | ||
console.log((clean_variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0].toLowerCase()+default_options.separator).custom+" "+variable); | ||
break; | ||
case 'none': | ||
console.log((variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0]+":").custom +" "+variable); | ||
console.log((clean_variables[index].toString().replace(/\s/g, "").split('(')[1].split(')')[0]+":").custom +" "+variable); | ||
break; | ||
@@ -129,0 +143,0 @@ |
{ | ||
"name": "letlog", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Log variables to console with label of variable name", | ||
@@ -31,4 +31,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"colors": "^1.1.2", | ||
"node-cache": "^4.1.1" | ||
} | ||
} |
9054
122
2
+ Addedcolors@^1.1.2
+ Addedcolors@1.4.0(transitive)