Update outdated Node package.
This commit is contained in:
parent
11d56696ec
commit
d6fc379360
3 changed files with 32 additions and 3 deletions
26
node_modules/glob-parent/index.js
generated
vendored
26
node_modules/glob-parent/index.js
generated
vendored
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue