@lvce-editor/text-search-worker 7.20.0 → 7.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/textSearchWorkerMain.js +11 -1
- package/package.json +1 -1
|
@@ -1508,8 +1508,18 @@ const getContextArgs = contextLines => {
|
|
|
1508
1508
|
const trimPart = part => {
|
|
1509
1509
|
return part.trim();
|
|
1510
1510
|
};
|
|
1511
|
+
const hasGlob = pattern => {
|
|
1512
|
+
return pattern.includes('*') || pattern.includes('?') || pattern.includes('[') || pattern.includes('{');
|
|
1513
|
+
};
|
|
1511
1514
|
const toGlob = pattern => {
|
|
1512
|
-
|
|
1515
|
+
const args = ['--glob', pattern];
|
|
1516
|
+
if (!hasGlob(pattern)) {
|
|
1517
|
+
const normalizedPattern = pattern.endsWith('/') ? pattern.slice(0, -1) : pattern;
|
|
1518
|
+
if (normalizedPattern) {
|
|
1519
|
+
args.push('--glob', `${normalizedPattern}/**`);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
return args;
|
|
1513
1523
|
};
|
|
1514
1524
|
const getIncludeArgs = include => {
|
|
1515
1525
|
return (include || '').split(',').map(trimPart).filter(Boolean).flatMap(toGlob);
|