lib/changed.js
async function compareBuffer (filename, expectedContents) {
  try {
    const actualContents = await fs.readFile(filename)
    return !expectedContents.equals(actualContents)
  } catch (err) {
    return handleError(err)
  }
}
async function compareBuffer (filename, expectedContents) {
  try {
    const actualContents = await fs.readFile(filename)
    return !expectedContents.equals(actualContents)
  } catch (err) {
    return handleError(err)
  }
}
async function compareBuffer ( filename , expectedContents ) { try { const actualContents = await fs . readFile ( filename ) return ! expectedContents . equals ( actualContents ) } catch ( err ) { return handleError ( err ) } }
Compares a buffer with a file contents. Returns true, if they differ or the file does not exist.

@param {string} filename the file name
@param {Buffer} expectedContents the file contents
@returns {Promise<boolean>|boolean}
@private
Compares a buffer with a file contents . Returns true if they differ or the file does not exist .