Skip to content

Commit

Permalink
JavaScript Standard Style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Oct 21, 2015
1 parent 07aa1de commit 7b0ff81
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/copy-sync/__tests__/copy-sync-file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('+ copySync()', function () {
var destFile2 = path.join(TEST_DIR, 'dest2.css')
var destFile3 = path.join(TEST_DIR, 'dest3.jade')

var filter = function (s) {return s.split('.').pop() !== 'css'}
var filter = function (s) { return s.split('.').pop() !== 'css' }

fs.copySync(srcFile1, destFile1, filter)
fs.copySync(srcFile2, destFile2, filter)
Expand Down
1 change: 0 additions & 1 deletion lib/copy-sync/__tests__/copy-sync-preserve-time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,5 @@ describe('copy', function () {
}
}
}

})
})
1 change: 0 additions & 1 deletion lib/copy/__tests__/async/copy-gh-89.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ describe('copy / gh #89', function () {
done()
})
})

})
})
1 change: 0 additions & 1 deletion lib/copy/__tests__/copy-preserve-time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,5 @@ describe('copy', function () {
}
}
}

})
})
2 changes: 1 addition & 1 deletion lib/copy/__tests__/copy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('fs-extra', function () {
var srcFile1 = path.join(TEST_DIR, '1.css')
fs.writeFileSync(srcFile1, '')
var destFile1 = path.join(TEST_DIR, 'dest1.css')
var filter = function (s) { return s.split('.').pop() !== 'css'}
var filter = function (s) { return s.split('.').pop() !== 'css' }
fse.copy(srcFile1, destFile1, filter, function () {
assert(!fs.existsSync(destFile1))
done()
Expand Down
3 changes: 1 addition & 2 deletions lib/copy/__tests__/ncp/ncp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('ncp', function () {
if (curFile instanceof Object) {
return filter(curFile)
}

if (fileName.substr(fileName.length - 1) === 'a') {
delete files[fileName]
}
Expand Down Expand Up @@ -147,7 +148,6 @@ describe('ncp', function () {
next()
})
}, 100)

} else {
// console.log('Total callback count is', totalCallbacks)
assert.equal(totalCallbacks, expected)
Expand All @@ -156,7 +156,6 @@ describe('ncp', function () {
}

next()

})
})
})
Expand Down
1 change: 0 additions & 1 deletion lib/ensure/__tests__/link.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,4 @@ describe('fse-ensure-link', function () {
if (newBehavior === 'file-dest-exists') fileDestExistsSync(args, fn)
})
})

})
2 changes: 0 additions & 2 deletions lib/ensure/__tests__/symlink-paths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'ensure-symlink')
/* global afterEach, beforeEach, describe, it, after, before */

describe('symlink-type', function () {

before(function () {
fse.emptyDirSync(TEST_DIR)
process.chdir(TEST_DIR)
Expand Down Expand Up @@ -89,5 +88,4 @@ describe('symlink-type', function () {
})
})
})

})
2 changes: 0 additions & 2 deletions lib/ensure/__tests__/symlink-type.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'ensure-symlink')
/* global afterEach, beforeEach, describe, it, after, before */

describe('symlink-type', function () {

before(function () {
fse.emptyDirSync(TEST_DIR)
process.chdir(TEST_DIR)
Expand Down Expand Up @@ -120,5 +119,4 @@ describe('symlink-type', function () {
})
})
})

})
1 change: 0 additions & 1 deletion lib/ensure/__tests__/symlink.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,5 +447,4 @@ describe('fse-ensure-symlink', function () {
if (newBehavior === 'dir-dest-exists') dirDestExistsSync(args, fn)
})
})

})
2 changes: 1 addition & 1 deletion lib/ensure/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function createLink (srcpath, dstpath, callback) {
err.message = err.message.replace('lstat', 'ensureLink')
return callback(err)
}

var dir = path.dirname(dstpath)
fs.exists(dir, function (dirExists) {
if (dirExists) return makeLink(srcpath, dstpath)
Expand All @@ -30,7 +31,6 @@ function createLink (srcpath, dstpath, callback) {
}

function createLinkSync (srcpath, dstpath, callback) {

var destinationExists = fs.existsSync(dstpath)
if (destinationExists) return undefined

Expand Down
2 changes: 1 addition & 1 deletion lib/ensure/symlink-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function symlinkTypeSync (srcpath, type) {
if (type) return type
try {
var stats = fs.lstatSync(srcpath)
} catch(e) {
} catch (e) {
return 'file'
}
return (stats && stats.isDirectory()) ? 'dir' : 'file'
Expand Down

0 comments on commit 7b0ff81

Please sign in to comment.