diff -rupN --no-dereference yarn-1.22.19/node_modules/glob-parent/index.js yarn-1.22.19-new/node_modules/glob-parent/index.js
--- yarn-1.22.19/node_modules/glob-parent/index.js 2022-12-15 10:13:44.000000000 +0100
+++ yarn-1.22.19-new/node_modules/glob-parent/index.js 2023-01-04 00:11:24.718113215 +0100
@@ -10,7 +10,7 @@ module.exports = function globParent(str
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
// special case for strings ending in enclosure containing path separator
- if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
+ if (isEnclosure(str)) str += '/';
// preserves full path in case of trailing path separator
str += 'a';
@@ -22,3 +22,26 @@ module.exports = function globParent(str
// remove escape chars and return result
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$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('/');
+}