(schema: Schema.Schema<T>)
| 25 | type Model = { id: string } & Record<string, unknown> |
| 26 | |
| 27 | export const f2 = <T extends Model>(schema: Schema.Schema<T>) => { |
| 28 | type Patch = Pick<T, "id"> & Partial<Omit<T, "id">> |
| 29 | |
| 30 | const patch: Schema.Schema<Patch> = schema.pipe( |
| 31 | Schema.pick("id"), |
| 32 | Schema.extend(schema.pipe(Schema.omit("id"), Schema.partial)) |
| 33 | ) |
| 34 | |
| 35 | return patch |
| 36 | } |