fix type incompatibility with array.sort()

This commit is contained in:
Simon
2016-07-21 10:47:18 -04:00
parent 2aa973a605
commit e3865142f9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -446,7 +446,7 @@ mongooseArray.pull(5, 4, 'hi').$shift();
mongooseArray.push([]).toFixed();
mongooseArray.set(1, 'hi').$shift();
mongooseArray.shift().toLowerCase();
mongooseArray.sort(function (a: any, b: any) {
mongooseArray.sort(function (a, b) {
return a.length - b.length;
}).unshift();
mongooseArray.splice(4, 1).unshift();
+1 -1
View File
@@ -1141,7 +1141,7 @@ declare module "mongoose" {
* potentially overwritting any changes that happen between when you retrieved the object
* and when you save it.
*/
sort(compare?: Function): T[];
sort(compareFn?: (a: T, b: T) => number): T[];
/**
* Wraps Array#splice with proper change tracking and casting.