Update outdated Node package.

This commit is contained in:
Edoardo Pirovano 2021-07-21 14:20:10 +01:00
parent 11d56696ec
commit d6fc379360
No known key found for this signature in database
GPG key ID: 047556B5D93FFE28
3 changed files with 32 additions and 3 deletions

26
node_modules/glob-parent/index.js generated vendored
View file

@ -6,7 +6,6 @@ var isWin32 = require('os').platform() === 'win32';
var slash = '/';
var backslash = /\\/g;
var enclosure = /[{[].*\/.*[}\]]$/;
var globby = /(^|[^\\])([{[]|\([^)]+$)/;
var escaped = /\\([!*?|[\](){}])/g;
@ -24,7 +23,7 @@ module.exports = function globParent(str, opts) {
}
// special case for strings ending in enclosure containing path separator
if (enclosure.test(str)) {
if (isEnclosure(str)) {
str += slash;
}
@ -39,3 +38,26 @@ module.exports = function globParent(str, opts) {
// remove escape chars and return result
return str.replace(escaped, '$1');
};
function isEnclosure(str) {
var lastChar = str.slice(-1);
var enclosureStart;
switch (lastChar) {
case '}':
enclosureStart = '{';
break;
case ']':
enclosureStart = '[';
break;
default:
return false;
}
var foundIndex = str.indexOf(enclosureStart);
if (foundIndex < 0) {
return false;
}
return str.slice(foundIndex + 1, -1).includes(slash);
}