From fc8d2093541bfe5507df2fe926cd6cde6cbb091f Mon Sep 17 00:00:00 2001 From: Aleksey Petrov Date: Sun, 18 Oct 2020 13:23:37 +0300 Subject: [PATCH] nullOject param case insensetive --- src/lineToJson.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lineToJson.ts b/src/lineToJson.ts index b89ee81..0861d59 100644 --- a/src/lineToJson.ts +++ b/src/lineToJson.ts @@ -135,8 +135,11 @@ function setPath(resultJson: any, head: string, value: any, conv: Converter,head } } } - if (conv.parseParam.nullObject ===true && value ==="null"){ - value=null; + if (conv.parseParam.nullObject === true + && typeof value === 'string' + && value.toLowerCase() === "null" + ) { + value = null; } conv.parseRuntime.columnValueSetter[headIdx](resultJson, head, value); // flatSetter(resultJson, head, value);