@lvce-editor/text-search-worker 7.20.0 → 7.21.0

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.
@@ -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
- return ['--glob', pattern];
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "7.20.0",
3
+ "version": "7.21.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"