Skip to content

Commit

Permalink
Merge pull request #432 from INCF/chrisfilo-patch-12
Browse files Browse the repository at this point in the history
[WIP] Improve header check robustness
  • Loading branch information
chrisgorgo authored Mar 13, 2018
2 parents 7bd54b4 + e0f70d8 commit 4b54b94
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions validators/tsv.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,19 @@ var TSV = function TSV (file, contents, fileList, callback) {

// events.tsv
if (file.name.endsWith('_events.tsv')) {
if (headers[0] !== "onset"){
if ((headers.length == 0) || (headers[0] !== "onset")){
issues.push(new Issue({
file: file,
evidence: headers,
line: 1,
character: rows[0].indexOf(headers[0]),
code: 20
}));
}
if (headers[1].trim() !== "duration"){
if ((headers.length == 1) || (headers[1].trim() !== "duration")){
issues.push(new Issue({
file: file,
evidence: headers,
line: 1,
character: rows[0].indexOf(headers[1]),
code: 21
}));
}
Expand Down

0 comments on commit 4b54b94

Please sign in to comment.