特性: instanceToPlain 返回类型更好
作者: alvissraghnall创建于 2025年11月1日更新于 2025年11月13日
标签type: featureflag: needs discussion
描述
从之前的问题中摘录 [因为我分享了他们的思考过程]:
class MyClass {
@Expose({ name: 'desc', toPlainOnly: true })
description: string
}
const x = { description: 'asc' }
const y = plainToInstance(MyClass, x)
const z = instanceToPlain(y) // type: Record<string, any>;建议的解决方案
我需要查看代码库。现在先记录一下,以便一分钟后可以回到这个问题。
内容来源: typestack/class-transformer