From 7dec66edfc78a318c53ce7d863357577ac1afe66 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Fri, 25 Nov 2022 15:58:10 +0100 Subject: [PATCH] Make `convertAttributeNameToForm` type-safe (#3869) --- apps/admin-ui/src/util.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/admin-ui/src/util.ts b/apps/admin-ui/src/util.ts index a7fb18e406..ef54762833 100644 --- a/apps/admin-ui/src/util.ts +++ b/apps/admin-ui/src/util.ts @@ -82,9 +82,11 @@ const isAttributeArray = (value: any) => { const isEmpty = (obj: any) => Object.keys(obj).length === 0; -export const convertAttributeNameToForm = (name: string) => { +export const convertAttributeNameToForm = (name: T) => { const index = name.indexOf("."); - return `${name.substring(0, index)}.${beerify(name.substring(index + 1))}`; + return `${name.substring(0, index)}.${beerify( + name.substring(index + 1) + )}` as ReplaceString; }; const beerify = (name: T) =>