File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
bids-validator/validators/tsv Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11const Issue = require ( '../../utils' ) . issues . Issue
22
3+ /**
4+ * Checks status column in a electroencephalography _channels.tsv file to
5+ * ensure its values are only * 'good', 'bad', or 'n/a'
6+ * @param {string[] } rows - Each row of a tsv file to be checked.
7+ * @param {Object } file - File of rows being checked, used for error message if
8+ * problem is found.
9+ * @param {Object[] } issues - Array of issue objects to add to if problem is
10+ * found.
11+ * @returns {null } Results of this function are stored in issues.
12+ */
313const checkStatusCol = function ( rows , file , issues ) {
414 const header = rows [ 0 ]
515 const statusColumn = header . indexOf ( 'status' )
616 if ( statusColumn !== - 1 ) {
717 for ( let i = 1 ; i < rows . length ; i ++ ) {
818 const line = rows [ i ]
919 const status = line [ statusColumn ]
10- if ( status !== 'good' && status !== 'bad' ) {
20+ if ( status !== 'good' && status !== 'bad' && status != 'n/a' ) {
1121 issues . push (
1222 new Issue ( {
1323 file : file ,
1424 evidence : line ,
1525 line : i + 1 ,
16- reason : 'the status column values should either be good or bad ' ,
26+ reason :
27+ 'the status column values should either be good, bad, or n/a' ,
1728 code : 125 ,
1829 } ) ,
1930 )
You can’t perform that action at this time.
0 commit comments