updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

38
node_modules/del/index.js generated vendored
View File

@@ -11,29 +11,27 @@ const rimrafP = pify(rimraf);
function safeCheck(file) {
if (isPathCwd(file)) {
throw new Error('Cannot delete the current working directory. Can be overriden with the `force` option.');
throw new Error('Cannot delete the current working directory. Can be overridden with the `force` option.');
}
if (!isPathInCwd(file)) {
throw new Error('Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.');
throw new Error('Cannot delete files/folders outside the current working directory. Can be overridden with the `force` option.');
}
}
module.exports = (patterns, opts) => {
opts = Object.assign({}, opts);
const del = (patterns, options) => {
options = Object.assign({}, options);
const force = opts.force;
delete opts.force;
const dryRun = opts.dryRun;
delete opts.dryRun;
const {force, dryRun} = options;
delete options.force;
delete options.dryRun;
const mapper = file => {
if (!force) {
safeCheck(file);
}
file = path.resolve(opts.cwd || '', file);
file = path.resolve(options.cwd || '', file);
if (dryRun) {
return file;
@@ -42,24 +40,26 @@ module.exports = (patterns, opts) => {
return rimrafP(file, {glob: false}).then(() => file);
};
return globby(patterns, opts).then(files => pMap(files, mapper, opts));
return globby(patterns, options).then(files => pMap(files, mapper, options));
};
module.exports.sync = (patterns, opts) => {
opts = Object.assign({}, opts);
module.exports = del;
// TODO: Remove this for the next major release
module.exports.default = del;
const force = opts.force;
delete opts.force;
module.exports.sync = (patterns, options) => {
options = Object.assign({}, options);
const dryRun = opts.dryRun;
delete opts.dryRun;
const {force, dryRun} = options;
delete options.force;
delete options.dryRun;
return globby.sync(patterns, opts).map(file => {
return globby.sync(patterns, options).map(file => {
if (!force) {
safeCheck(file);
}
file = path.resolve(opts.cwd || '', file);
file = path.resolve(options.cwd || '', file);
if (!dryRun) {
rimraf.sync(file, {glob: false});