Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed Jan 13, 2017
1 parent 6e5fcb0 commit d94514c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions lib/changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
* @param err
* @returns {boolean}
*/
function handleError(err) {
function handleError (err) {
if (err.code === 'ENOENT') {
return true
}
Expand All @@ -41,7 +41,7 @@ function handleError(err) {
* @returns {Promise<boolean>|boolean}
* @private
*/
function compareString(filename, contents) {
function compareString (filename, contents) {
return qfs.read(filename)
.then(function (fileContents) {
return fileContents !== contents
Expand All @@ -56,7 +56,7 @@ function compareString(filename, contents) {
* @returns {Promise<boolean>|boolean}
* @private
*/
function compareBuffer(filename, contents) {
function compareBuffer (filename, contents) {
return qfs.read(filename, 'b')
.then(function (fileContents) {
if (Buffer.prototype.equals) {
Expand All @@ -65,16 +65,16 @@ function compareBuffer(filename, contents) {
// http://stackoverflow.com/questions/30701220/how-to-compare-buffer-objects-in-nodejs
// Compatibility node 0.10
var areBuffersEqual = function (bufA, bufB) {
var len = bufA.length;
var len = bufA.length
if (len !== bufB.length) {
return false;
return false
}
for (var i = 0; i < len; i++) {
if (bufA.readUInt8(i) !== bufB.readUInt8(i)) {
return false;
return false
}
}
return true;
return true
}
return !areBuffersEqual(contents, fileContents)
}
Expand All @@ -88,7 +88,7 @@ function compareBuffer(filename, contents) {
* @returns {Promise<boolean>|boolean}
* @private
*/
function compareStream(filename, contents) {
function compareStream (filename, contents) {
return Q.nfcall(streamEqual, contents, fs.createReadStream(filename))
.then(function (result) {
return !result
Expand Down
2 changes: 1 addition & 1 deletion test/main-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function createStream (contents) {
return s
}

function createBuffer(contents) {
function createBuffer (contents) {
return Buffer.from ? Buffer.from(contents) : new Buffer(contents)
}

Expand Down

0 comments on commit d94514c

Please sign in to comment.