Skip to content

Commit

Permalink
fix: filter out empty split pattern results in search
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Mar 31, 2024
1 parent 5d5125f commit c961317
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webui/src/utils/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function globFilterModules(
return items;
}

const matcher = picomatch(options.include ? splitPattern(options.include) : '**', {
const matcher = picomatch(splitPattern(options.include || '**'), {
cwd: '',
dot: true,
nocase: true,
Expand All @@ -38,5 +38,6 @@ export function globFilterModules(
* This splits on any combination of `,` and whitespaces.
*/
function splitPattern(pattern: string) {
return pattern.split(/\s*,\s*/);
const split = pattern.split(/\s*,\s*/).filter(Boolean);
return split.length ? split : undefined;
}

0 comments on commit c961317

Please sign in to comment.