From c178ca149a0516841f4594329daffc81a1ae68fb Mon Sep 17 00:00:00 2001 From: David Mason Date: Wed, 10 Feb 2016 16:58:06 +1000 Subject: [PATCH] Support symbol action types Symbol action types cause an error as they are not implicitly converted to strings when trying to concatenate them with another string. This just wraps the action type in String(...) when it is being printed so it should work regardless of the typeof the action type constant. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d5be3f8..973b9dc 100644 --- a/src/index.js +++ b/src/index.js @@ -71,7 +71,7 @@ function createLogger(options = {}) { const formattedTime = formatTime(time); const titleCSS = colors.title ? `color: ${colors.title(formattedAction)};` : null; - const title = `action ${formattedAction.type}${timestamp ? formattedTime : ``}${duration ? ` in ${took.toFixed(2)} ms` : ``}`; + const title = `action ${String(formattedAction.type)}${timestamp ? formattedTime : ``}${duration ? ` in ${took.toFixed(2)} ms` : ``}`; // render try {