Reported by Christian Yang (@yangchristian) in #2775 (comment)
I repro Andreas Larsen (@larsenwork)'s issue with the following:
typeCreatedOrUpdatedAt={createdAt: Date|string}|{updatedAt: Date|string};constdatePropComp=<TextendsCreatedOrUpdatedAt,KextendskeyofT>(a: T,b: T,field: K)=>{// The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.constdateA=a[field]instanceofDate ? a[field] : newDate(a[field]);constdateB=b[field]instanceofDate ? b[field] : newDate(b[field]);returndateA.getTime()-dateB.getTime();};datePropComp({updatedAt: Date()},{updatedAt: Date()},'updatedAt')Playground link
Reported by Christian Yang (@yangchristian) in #2775 (comment)
I repro Andreas Larsen (@larsenwork)'s issue with the following:
Playground link