【发布时间】:2018-12-12 12:59:53
【问题描述】:
我有 2 个打字稿接口:
interface IObject1 {
propOne: string,
propTwo: string,
...
}
interface IObject2 {
'some.prefix.propOne': string,
'some.prefix.propTwo': string,
...
}
有没有更短的方法可以从 IObject1 创建 IObject2 ?
【问题讨论】:
-
编译时不能对键进行字符串操作
-
在 GitHub 中查看 the relevant issue
标签: typescript