lib/Core/readJson.js
function readJson(file) {
  return when(
    readText(file),
    function(result) {
      try {
        return JSON.parse(result);
      } catch (e) {
        if (e instanceof SyntaxError) {
          return json5.parse(result);
        } else {
          throw e;
        }
      }
    },
    function(e) {
      throw e;
    }
  );
}
function readJson(file) {
  return when(
    readText(file),
    function(result) {
      try {
        return JSON.parse(result);
      } catch (e) {
        if (e instanceof SyntaxError) {
          return json5.parse(result);
        } else {
          throw e;
        }
      }
    },
    function(e) {
      throw e;
    }
  );
}
function readJson ( file ) { return when ( readText ( file ) , function ( result ) { try { return JSON . parse ( result ) ; } catch ( e ) { if ( e instanceof SyntaxError ) { return json5 . parse ( result ) ; } else { throw e ; } } } , function ( e ) { throw e ; } ) ; }
Try to read the file as JSON. If that fails, try JSON5.
@param  {File} file The file.
@return {Object} The JSON or json5 object described by the file.
Try to read the file as JSON . If that fails try JSON5 .