From 9142a99b221a939b8c8d7dc284180d792671cb69 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Fri, 1 Aug 2025 20:36:06 +0200 Subject: [PATCH] (refactor) rename and move entriesWithKeys and getWithKey utilities to ~~/shared/utils --- app/components/nouns/NounsClassSelectTable.vue | 2 +- app/components/nouns/NounsConventionsIndex.vue | 2 +- app/components/nouns/NounsConventionsIndexGroup.vue | 2 +- app/components/nouns/NounsRegularWordsSubform.vue | 2 +- app/middleware/languageItemFromPath.ts | 2 +- shared/classes.ts | 1 + app/utils/withKey.ts => shared/utils/entriesWithKeys.ts | 0 {app => shared}/utils/getWithKey.ts | 2 +- 8 files changed, 7 insertions(+), 6 deletions(-) rename app/utils/withKey.ts => shared/utils/entriesWithKeys.ts (100%) rename {app => shared}/utils/getWithKey.ts (78%) diff --git a/app/components/nouns/NounsClassSelectTable.vue b/app/components/nouns/NounsClassSelectTable.vue index f1eeb74b3..da3d7a0f1 100644 --- a/app/components/nouns/NounsClassSelectTable.vue +++ b/app/components/nouns/NounsClassSelectTable.vue @@ -16,7 +16,7 @@ const config = useConfig(); const nounsData = await loadNounsData(); const nouns = computed((): Noun[] => { - return withKey(nounsData.classes ?? {}) + return entriesWithKeys(nounsData.classes ?? {}) .map((nounClass): NounClassInstance => ({ classKey: nounClass.key, stems: props.stemValues })) .map((classInstance, i): NounRawWithLoadedWords => ({ id: `template-${i}`, diff --git a/app/components/nouns/NounsConventionsIndex.vue b/app/components/nouns/NounsConventionsIndex.vue index 1d1edf757..059c43dcc 100644 --- a/app/components/nouns/NounsConventionsIndex.vue +++ b/app/components/nouns/NounsConventionsIndex.vue @@ -7,7 +7,7 @@ const nounsData = await loadNounsData();