Skip to content

Commit

Permalink
Generic data index for error message implemented
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dhirajjadhavrao authored May 11, 2021
1 parent f846554 commit 853df72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/csv-file-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 853df72

Please sign in to comment.