我试图使用字符串模板类型来表示带有有意义前缀的ids,例如dta-t-${string},其中dta-t-编码了有关实体的一些信息。我有一些由字符串模板的联合索引的记录类型,例如type FacetTemplateId = `fct-t-${stringbe used to index type '<
我正在转换一个代码库从Javascript到Typescript,并且在这个函数上有问题。' can't be used to index type '{}'.No index signature with a parameter of type 'string' was found on type '{}'.ts(7053)
我以为我可以通过检查T中是否存在该属性来避免错误export const convertArrayToDict = &