check_format.js
function checkFile(path) {
  const formatter = path.match(/\.md$/) ? prettierFormat : clangFormat;
  const source = fs.readFileSync(path, 'utf8');
  const formatted = formatter(path, source);
  if (source !== formatted) {
    return formatted;
  }
  return null;
}
function checkFile(path) {
  const formatter = path.match(/\.md$/) ? prettierFormat : clangFormat;
  const source = fs.readFileSync(path, 'utf8');
  const formatted = formatter(path, source);
  if (source !== formatted) {
    return formatted;
  }
  return null;
}
function checkFile ( path ) { const formatter = path . match ( / \.md$ / ) ? prettierFormat : clangFormat ; const source = fs . readFileSync ( path , 'utf8' ) ; const formatted = formatter ( path , source ) ; if ( source !== formatted ) { return formatted ; } return null ; }
Checks that a path is formatted.
@return new text of file if it needs formatting or null otherwise.
Checks that a path is formatted .