@kitql/helper
Advanced tools
Comparing version 0.4.0 to 0.5.0
11
index.js
@@ -16,3 +16,3 @@ 'use strict'; | ||
node: `\x1b[35m`, | ||
browser: 'color: magneta', | ||
browser: 'color: #ff00ff', | ||
}, | ||
@@ -89,4 +89,5 @@ red: { | ||
table.push(`${msg}`); | ||
let str = table.join(''); | ||
const str = table.join(''); | ||
if (browser) { | ||
let replacedStr = str; | ||
// switch to browser console | ||
@@ -100,4 +101,4 @@ const posToReplace = []; | ||
}); | ||
// replace with %c | ||
str = str.replaceAll(config[key].node, '%c'); | ||
// replace with %c in another str to make sure we don't change the order of indexes | ||
replacedStr = replacedStr.replaceAll(config[key].node, '%c'); | ||
} | ||
@@ -110,3 +111,3 @@ const colors = []; | ||
}); | ||
return [str, ...colors]; | ||
return [replacedStr, ...colors]; | ||
} | ||
@@ -113,0 +114,0 @@ // wrap it because we always unwrap after ;) |
{ | ||
"name": "@kitql/helper", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
17456
498