Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint-config-xo-space to the latest version 🚀 #100

Merged
merged 2 commits into from
Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('#commit()', () => {

let filter = through.obj(function (file, enc, cb) {
called++;
file.contents = new Buffer('modified');
file.contents = Buffer.from('modified');
this.push(file);
cb();
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('#read()', () => {

it('returns defaults as Buffer if file does not exist and defaults is provided', () => {
const content = fs.read('file-who-does-not-exist.txt', {
defaults: new Buffer('foo\n'),
defaults: Buffer.from('foo\n'),
raw: true
});
expect(content).toBeInstanceOf(Buffer);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('#write()', () => {

it('write buffer to a new file', () => {
const filepath = path.join(__dirname, 'fixtures/does-not-exist.txt');
const contents = new Buffer('omg!', 'base64');
const contents = Buffer.from('omg!', 'base64');
fs.write(filepath, contents);
expect(fs.read(filepath)).toBe(contents.toString());
expect(fs.store.get(filepath).state).toBe('modified');
Expand Down
6 changes: 4 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ exports.globify = function (filePath) {

if (glob.hasMagic(filePath)) {
return filePath;
} else if (!fs.existsSync(filePath)) {
}
if (!fs.existsSync(filePath)) {
// The target of a pattern who's not a glob and doesn't match an existing
// entity on the disk is ambiguous. As such, match both files and directories.
return [
Expand All @@ -47,7 +48,8 @@ exports.globify = function (filePath) {
var fsStats = fs.statSync(filePath);
if (fsStats.isFile()) {
return filePath;
} else if (fsStats.isDirectory()) {
}
if (fsStats.isDirectory()) {
return path.join(filePath, '**');
}
throw new Error('Only file path or directory path are supported.');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"coveralls": "^3.0.0",
"escape-regexp": "0.0.1",
"eslint": "^4.1.0",
"eslint-config-xo-space": "^0.17.0",
"eslint-config-xo-space": "^0.18.0",
"jest": "^22.1.0",
"mem-fs": "^1.0.0",
"nsp": "^3.1.0",
Expand Down