bids-validator/utils/json.js
/**
 * JSHint
 *
 * Checks known invalid JSON file
 * content in order to produce a
 * verbose error message.
 */
JSHint
Checks known invalid JSON file
content in order to produce a
verbose error message.
JSHint Checks known invalid JSON file content in order to produce a verbose error message .
function jshint(file, contents, callback) {
  var issues = []
  if (!JSHINT(contents)) {
    var out = JSHINT.data()
    for (var i = 0; out.errors.length > i; ++i) {
      var error = out.errors[i]
      if (error) {
        issues.push(
          new Issue({
            code: 27,
            file: file,
            line: error.line ? error.line : null,
            character: error.character ? error.character : null,
            reason: error.reason ? error.reason : null,
            evidence: error.evidence ? error.evidence : null,
          }),
        )
      }
    }
  }
  callback(issues)
}
function jshint ( file , contents , callback ) { var issues = [ ] if ( ! JSHINT ( contents ) ) { var out = JSHINT . data ( ) for ( var i = 0 ; out . errors . length > i ; ++ i ) { var error = out . errors [ i ] if ( error ) { issues . push ( new Issue ( { code : 27 , file : file , line : error . line ? error . line : null , character : error . character ? error . character : null , reason : error . reason ? error . reason : null , evidence : error . evidence ? error . evidence : null , } ) , ) } } } callback ( issues ) }
JSHint
 Checks known invalid JSON file
 content in order to produce a
 verbose error message.
JSHint Checks known invalid JSON file content in order to produce a verbose error message .