Open sccgaochengyi opened 1 year ago
感谢作者的辛勤劳动,这个包解析的效果非常好。
不过在涉及到 Pick Omit 时,估计是因为我使用方式与 demo 中的不同,所以没解析出来。
export type CompetitorCompanyDBEntry = { name?: string; creatorId: number; }; export const competitorCompanyPickFields = Object.freeze(['creatorId'] as const); export type CompetitorCompany = Pick< CompetitorCompanyDBEntry, (typeof competitorCompanyPickFields)[number] > & { name: string; };
解析出来的效果是
"CompetitorCompany": { "allOf": [ { "$ref": "#Pick", "items": { "$ref": "#CompetitorCompanyDBEntry" } }, { "type": "object", "properties": { "name": { "type": "string" }, }, "required": [ "name" ] } ] }
我估计是因为使用 (typeof competitorCompanyPickFields)[number] 的方式,导致 Pick 并没有能成功取出字段,能看下是否能支持吗
感谢作者的辛勤劳动,这个包解析的效果非常好。
不过在涉及到 Pick Omit 时,估计是因为我使用方式与 demo 中的不同,所以没解析出来。
解析出来的效果是
我估计是因为使用 (typeof competitorCompanyPickFields)[number] 的方式,导致 Pick 并没有能成功取出字段,能看下是否能支持吗