From 853df72158fd63e713522b1488ffafd4219fe194 Mon Sep 17 00:00:00 2001 From: dhiraj-jadhavrao <31136708+dhirajjadhavrao@users.noreply.github.com> Date: Tue, 11 May 2021 11:55:02 +0530 Subject: [PATCH] Generic data index for error message implemented The index value is incremented by 2 as in the data parsing index is consider with headers and then it is increased by 1 makes the actual data index increase by two . so here index is incremented by 2 to make error messages consistent --- src/csv-file-validator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/csv-file-validator.js b/src/csv-file-validator.js index d8d0a51..9e784d9 100644 --- a/src/csv-file-validator.js +++ b/src/csv-file-validator.js @@ -144,9 +144,9 @@ if (duplicates.indexOf(value) >= 0) { file.inValidMessages.push( _isFunction(header.uniqueError) - ? header.uniqueError(header.name, rowIndex + 1) + ? header.uniqueError(header.name, rowIndex + 2) : String( - header.name + " is not unique at the " + (rowIndex + 1) + "row" + header.name + " is not unique at the " + (rowIndex + 2) + "row" ) ); } else {