From 590d19a82fd30bea67c2fb465eb3dea1442fa22f Mon Sep 17 00:00:00 2001 From: Juanjo Diaz Date: Mon, 27 May 2019 01:03:58 +0300 Subject: [PATCH] fix: Improve the inference of the header name when using function as value (#395) --- 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,