Update dependencies
This commit is contained in:
parent
48e8c8a1af
commit
95d054f9b4
7555 changed files with 144369 additions and 196135 deletions
31
node_modules/path-exists/index.js
generated
vendored
31
node_modules/path-exists/index.js
generated
vendored
|
@ -1,23 +1,24 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const {promisify} = require('util');
|
||||
var fs = require('fs');
|
||||
var Promise = require('pinkie-promise');
|
||||
|
||||
const pAccess = promisify(fs.access);
|
||||
module.exports = function (fp) {
|
||||
var fn = typeof fs.access === 'function' ? fs.access : fs.stat;
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
fn(fp, function (err) {
|
||||
resolve(!err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.sync = function (fp) {
|
||||
var fn = typeof fs.accessSync === 'function' ? fs.accessSync : fs.statSync;
|
||||
|
||||
module.exports = async path => {
|
||||
try {
|
||||
await pAccess(path);
|
||||
fn(fp);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.sync = path => {
|
||||
try {
|
||||
fs.accessSync(path);
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue