From 1c038e66a6ea9557fa944857d768ffa9ec8e31e9 Mon Sep 17 00:00:00 2001 From: Matus Majchrak Date: Sun, 11 Aug 2019 11:14:48 +0200 Subject: [PATCH] Cleans up left-over log and optmize regex match --- .../TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx index c474380fc8..2b316068d8 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx @@ -27,10 +27,9 @@ const jsonObjectOrArrayStartRegex = /^(\[|\{)/; function parseIfComplexJson(value: any) { // if the value is a string representing actual json object or array, then use json-markup - if (typeof value === 'string' && value.match(jsonObjectOrArrayStartRegex)) { + if (typeof value === 'string' && jsonObjectOrArrayStartRegex.test(value)) { // otherwise just return as is try { - console.log('parsing JSON'); return JSON.parse(value); // eslint-disable-next-line no-empty } catch (_) {}