Skip to content

Commit

Permalink
fix: better glob indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 10, 2024
1 parent bba01c7 commit 7457569
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions frontend/src/composables/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ export function useGlob(glob: Record<string, GlobModule>): GlobState {
return glob[key].default;
}

return Object.values(glob).find((module) => {
const parts = module.default.split('/');
return parts[parts.length - 1] === key;
})?.default;
for (const item in glob) {
const parts = item.split('/');

if (parts[parts.length - 1] === key) {
return glob[item].default;
}
}
}

return {
Expand Down

0 comments on commit 7457569

Please sign in to comment.