@kitql/helper
Advanced tools
Comparing version
@@ -51,2 +51,5 @@ "use strict"; | ||
class Log { | ||
get isBrowser() { | ||
return typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
} | ||
constructor(toolName, options) { | ||
@@ -59,5 +62,2 @@ var _a, _b, _c; | ||
} | ||
get isBrowser() { | ||
return typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
} | ||
setLevel(logLevel) { | ||
@@ -69,10 +69,10 @@ this.levelsToShow = logLevel; | ||
if (this.toolName) { | ||
table.push(`${logMagneta(`[${this.toolName}]`)}`); | ||
table.push(String(logMagneta(`[${this.toolName}]`))); | ||
} | ||
// DateTime or Time or nothing | ||
if (this.withDate === 'dateTime') { | ||
table.push(`${logMagneta(`[${new Date().toISOString()}]`)}`); | ||
table.push(String(logMagneta(`[${new Date().toISOString()}]`))); | ||
} | ||
else if (this.withDate === 'time') { | ||
table.push(`${logMagneta(`[${new Date().toISOString().split('T')[1]}]`)}`); | ||
table.push(String(logMagneta(`[${new Date().toISOString().split('T')[1]}]`))); | ||
} | ||
@@ -87,3 +87,3 @@ // Status icon or prefixEmoji | ||
else { | ||
table.push(`${this.prefixEmoji}`); | ||
table.push(String(this.prefixEmoji)); | ||
} | ||
@@ -95,3 +95,3 @@ table.push(indent); | ||
} | ||
table.push(`${msg}`); | ||
table.push(String(msg)); | ||
const str = table.join(''); | ||
@@ -98,0 +98,0 @@ if (browser) { |
@@ -23,8 +23,4 @@ "use strict"; | ||
} | ||
if (obj === undefined) { | ||
return undefined; | ||
} | ||
safe_stable_stringify_1.stringify.configure({ deterministic: true }); | ||
return (0, safe_stable_stringify_1.stringify)(obj, replacer, space); | ||
} | ||
exports.stry = stry; |
@@ -43,2 +43,5 @@ const config = { | ||
export class Log { | ||
get isBrowser() { | ||
return typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
} | ||
constructor(toolName, options) { | ||
@@ -51,5 +54,2 @@ var _a, _b, _c; | ||
} | ||
get isBrowser() { | ||
return typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
} | ||
setLevel(logLevel) { | ||
@@ -61,10 +61,10 @@ this.levelsToShow = logLevel; | ||
if (this.toolName) { | ||
table.push(`${logMagneta(`[${this.toolName}]`)}`); | ||
table.push(String(logMagneta(`[${this.toolName}]`))); | ||
} | ||
// DateTime or Time or nothing | ||
if (this.withDate === 'dateTime') { | ||
table.push(`${logMagneta(`[${new Date().toISOString()}]`)}`); | ||
table.push(String(logMagneta(`[${new Date().toISOString()}]`))); | ||
} | ||
else if (this.withDate === 'time') { | ||
table.push(`${logMagneta(`[${new Date().toISOString().split('T')[1]}]`)}`); | ||
table.push(String(logMagneta(`[${new Date().toISOString().split('T')[1]}]`))); | ||
} | ||
@@ -79,3 +79,3 @@ // Status icon or prefixEmoji | ||
else { | ||
table.push(`${this.prefixEmoji}`); | ||
table.push(String(this.prefixEmoji)); | ||
} | ||
@@ -87,3 +87,3 @@ table.push(indent); | ||
} | ||
table.push(`${msg}`); | ||
table.push(String(msg)); | ||
const str = table.join(''); | ||
@@ -90,0 +90,0 @@ if (browser) { |
@@ -19,7 +19,3 @@ /** | ||
} | ||
if (obj === undefined) { | ||
return undefined; | ||
} | ||
stringify.configure({ deterministic: true }); | ||
return stringify(obj, replacer, space); | ||
} |
{ | ||
"name": "@kitql/helper", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"dependencies": { | ||
"safe-stable-stringify": "^2.4.1" | ||
"safe-stable-stringify": "^2.4.2" | ||
}, | ||
@@ -7,0 +7,0 @@ "repository": { |
23216
-0.92%505
-1.56%Updated