improve module store with has

This commit is contained in:
root
2025-12-24 17:39:08 -05:00
parent bfee3e854d
commit a9afa7ce13

View File

@@ -24,5 +24,11 @@ export const useModuleStore = defineStore('moduleStore', {
},
},
getters: {
has: (state) => (handleOrNamespace: string) => {
const target = String(handleOrNamespace).toLowerCase();
return Object.values(state.modules).some(
(mod) => mod && (String(mod.handle).toLowerCase() === target || String(mod.namespace).toLowerCase() === target)
);
},
},
});