From 51dfae9dae0ba9dfa8e465afe61925cb796c39eb Mon Sep 17 00:00:00 2001 From: Juanjo Diaz Date: Sun, 26 May 2019 16:57:47 +0300 Subject: [PATCH] Improve the inference of the header name when using function as value --- lib/JSON2CSVBase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/JSON2CSVBase.js b/lib/JSON2CSVBase.js index d79429cb..42bff389 100644 --- a/lib/JSON2CSVBase.js +++ b/lib/JSON2CSVBase.js @@ -72,7 +72,7 @@ class JSON2CSVBase { } if (typeof fieldInfo.value === 'function') { - const label = fieldInfo.label || fieldInfo.value; + const label = fieldInfo.label || fieldInfo.value.name || ''; const field = { label, default: defaultValue }; return { label,