Updating NPM dependencies
This commit is contained in:
22
node_modules/path-exists/index.js
generated
vendored
22
node_modules/path-exists/index.js
generated
vendored
@@ -1,17 +1,23 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const {promisify} = require('util');
|
||||
|
||||
module.exports = fp => new Promise(resolve => {
|
||||
fs.access(fp, err => {
|
||||
resolve(!err);
|
||||
});
|
||||
});
|
||||
const pAccess = promisify(fs.access);
|
||||
|
||||
module.exports.sync = fp => {
|
||||
module.exports = async path => {
|
||||
try {
|
||||
fs.accessSync(fp);
|
||||
await pAccess(path);
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.sync = path => {
|
||||
try {
|
||||
fs.accessSync(path);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user