utils/bids_files.js
/**
 * Accepts path to sidecar file, the sidecar filename without extension
 * and the datafile that's a potential match
 * Returns boolean indicating if file evaluates as valid datafile
 */
Accepts path to sidecar file, the sidecar filename without extension
and the datafile that's a potential match
Returns boolean indicating if file evaluates as valid datafile
Accepts path to sidecar file the sidecar filename without extension and the datafile that ' s a potential match Returns boolean indicating if file evaluates as valid datafile
function verifyDatafileMatch(sidecarPath, noExt, matchFile) {
  let match = false
  let megDs = false
  const isSelf = matchFile.relativePath === sidecarPath
  if (!isSelf && type.file.isDatafile(matchFile.relativePath)) {
    match = true
  }
  if (
    !isSelf &&
    !match &&
    (noExt.endsWith('_meg') || noExt.endsWith('_coordsystem'))
  ) {
    megDs = matchFile.relativePath.includes('_meg.ds')
  }
  if (megDs) {
    match = true
  }
  return match
}
function verifyDatafileMatch ( sidecarPath , noExt , matchFile ) { let match = false let megDs = false const isSelf = matchFile . relativePath === sidecarPath if ( ! isSelf && type . file . isDatafile ( matchFile . relativePath ) ) { match = true } if ( ! isSelf && ! match && ( noExt . endsWith ( '_meg' ) || noExt . endsWith ( '_coordsystem' ) ) ) { megDs = matchFile . relativePath . includes ( '_meg.ds' ) } if ( megDs ) { match = true } return match }
Accepts path to sidecar file, the sidecar filename without extension
 and the datafile that's a potential match
 Returns boolean indicating if file evaluates as valid datafile
Accepts path to sidecar file the sidecar filename without extension and the datafile that ' s a potential match Returns boolean indicating if file evaluates as valid datafile
// Make sure it's not the data dictionary itself // MEG datafiles may be a folder, therefore not contained in fileList, will need to look in paths