From 0da790884ece889a38f7c655d3351c91b4b80848 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 7 Aug 2016 08:08:05 -0400 Subject: [PATCH] commented out array.sort() which may create errors depending on the version of lib.d.ts --- mongoose/mongoose.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 9d8eb390b0..421129320f 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -1122,7 +1122,9 @@ declare module "mongoose" { * potentially overwritting any changes that happen between when you retrieved the object * and when you save it. */ - sort(compareFn?: (a: T, b: T) => number): T[]; + // some lib.d.ts have return type "this" and others have return type "T[]" + // which causes errors. Let the inherited array provide the sort() method. + //sort(compareFn?: (a: T, b: T) => number): T[]; /** * Wraps Array#splice with proper change tracking and casting.