improve module store with has
This commit is contained in:
@@ -24,5 +24,11 @@ export const useModuleStore = defineStore('moduleStore', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
getters: {
|
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)
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user