Skip to content

Commit

Permalink
Glob import fix (#286)
Browse files Browse the repository at this point in the history
* fix: glob imports

* chore: linting

* fix: better glob indexing
  • Loading branch information
EwoutV committed Apr 10, 2024
1 parent 97b2116 commit e10675e
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 e10675e

Please sign in to comment.