From a9afa7ce13811e86ca6fb3e9a24bcec392992455 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 24 Dec 2025 17:39:08 -0500 Subject: [PATCH] improve module store with has --- core/src/stores/moduleStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/stores/moduleStore.ts b/core/src/stores/moduleStore.ts index 47d52f5..7eaa6a9 100644 --- a/core/src/stores/moduleStore.ts +++ b/core/src/stores/moduleStore.ts @@ -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) + ); + }, }, });