Implementing Generic Extension with TypeScript Copy Function
How to make this work with generic extends?
replacing
replacing
t: T -> t: Type workst: Tt: Typedeclare const copy: <A>(f: (a: NoInfer<A>) => Partial<NoInfer<A>>) => (self: A) => A
type Type = {
value: string | null
}
const test = <T extends Type>(t: T) => pipe(t, copy(({ value }) => ({ value: value ? value.toUpperCase() : value })))
// Type '{ value: string | null; }' is not assignable to type 'Partial<NoInfer<T>>'.