Skip to content

Commit

Permalink
Require Node.js 10 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Nov 5, 2020
1 parent 4616c03 commit 064e92d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -8,6 +8,5 @@ node_js:
- '14'
- '12'
- '10'
- '8'
after_success:
- './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov'
8 changes: 4 additions & 4 deletions index.js
Expand Up @@ -2,9 +2,9 @@
const fs = require('fs');
const path = require('path');
const {promisify} = require('util');
const semver = require('semver');
const semverGte = require('semver/functions/gte');

const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
const useNativeRecursiveOption = semverGte(process.version, '10.12.0');

// https://github.com/nodejs/node/issues/8987
// https://github.com/libuv/libuv/pull/1088
Expand Down Expand Up @@ -90,7 +90,7 @@ const makeDir = async (input, options) => {
if (!stats.isDirectory()) {
throw new Error('The path is not a directory');
}
} catch (_) {
} catch {
throw error;
}

Expand Down Expand Up @@ -143,7 +143,7 @@ module.exports.sync = (input, options) => {
if (!options.fs.statSync(pth).isDirectory()) {
throw new Error('The path is not a directory');
}
} catch (_) {
} catch {
throw error;
}
}
Expand Down
4 changes: 2 additions & 2 deletions index.test-d.ts
Expand Up @@ -8,7 +8,7 @@ import * as gfs from 'graceful-fs';
expectType<Promise<string>>(makeDir('path/to/somewhere'));

expectType<Promise<string>>(
makeDir('path/to/somewhere', {mode: parseInt('777', 8)})
makeDir('path/to/somewhere', {mode: 0o777})
);
expectType<Promise<string>>(makeDir('path/to/somewhere', {fs}));
expectType<Promise<string>>(makeDir('path/to/somewhere', {fs: gfs}));
Expand All @@ -17,7 +17,7 @@ expectType<Promise<string>>(makeDir('path/to/somewhere', {fs: gfs}));
expectType<string>(makeDirSync('path/to/somewhere'));

expectType<string>(
makeDirSync('path/to/somewhere', {mode: parseInt('777', 8)})
makeDirSync('path/to/somewhere', {mode: 0o777})
);
expectType<string>(makeDirSync('path/to/somewhere', {fs}));
expectType<string>(makeDirSync('path/to/somewhere', {fs: gfs}));
14 changes: 7 additions & 7 deletions package.json
Expand Up @@ -11,7 +11,7 @@
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava && tsd"
Expand Down Expand Up @@ -42,18 +42,18 @@
"file-system"
],
"dependencies": {
"semver": "^6.0.0"
"semver": "^7.3.2"
},
"devDependencies": {
"@types/graceful-fs": "^4.1.3",
"@types/node": "^13.7.1",
"ava": "^1.4.0",
"@types/node": "^14.14.6",
"ava": "^2.4.0",
"codecov": "^3.2.0",
"graceful-fs": "^4.1.15",
"nyc": "^15.0.0",
"path-type": "^4.0.0",
"tempy": "^0.2.1",
"tsd": "^0.11.0",
"xo": "^0.25.4"
"tempy": "^1.0.0",
"tsd": "^0.13.1",
"xo": "^0.34.2"
}
}

0 comments on commit 064e92d

Please sign in to comment.