Skip to content

Commit

Permalink
Require Node.js 6
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 20, 2018
1 parent 6c67e84 commit 2f773fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function relPath(base, filePath) {
filePath = filePath.replace(/\\/g, '/');
base = base.replace(/\\/g, '/');

if (filePath.indexOf(base) !== 0) {
if (!filePath.startsWith(base)) {
return filePath;
}

Expand Down Expand Up @@ -85,7 +85,7 @@ const plugin = () => {
// Attempt to parse the sourcemap's JSON to get the reverse filename
try {
reverseFilename = JSON.parse(file.contents.toString()).file;
} catch (err) {}
} catch (_) {}

if (!reverseFilename) {
reverseFilename = path.relative(path.dirname(file.path), path.basename(file.path, '.map'));
Expand Down Expand Up @@ -148,7 +148,7 @@ plugin.manifest = (pth, opts) => {

try {
oldManifest = opts.transformer.parse(manifestFile.contents.toString());
} catch (err) {}
} catch (_) {}

manifest = Object.assign(oldManifest, manifest);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -35,7 +35,7 @@
],
"dependencies": {
"modify-filename": "^1.1.0",
"plugin-error": "^0.1.2",
"plugin-error": "^1.0.1",
"rev-hash": "^2.0.0",
"rev-path": "^2.0.0",
"sort-keys": "^2.0.0",
Expand Down

0 comments on commit 2f773fd

Please sign in to comment.