diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 087b3a121c..df1b84f3b2 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -5306,13 +5306,13 @@ declare module _ { * Wrapped type `any[]`. * @see _.sortBy **/ - sortBy(iterator?: _.ListIterator, context?: any): _Chain; + sortBy(iterator?: _.ListIterator, context?: any): _Chain; /** * Wrapped type `any[]`. * @see _.sortBy **/ - sortBy(iterator: string, context?: any): _Chain; + sortBy(iterator: string, context?: any): _Chain; /** * Wrapped type `any[]`. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 15d2413d35..49e7d59961 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -196,6 +196,11 @@ _.min(numbers); _.sortBy([1, 2, 3, 4, 5, 6], (num) => Math.sin(num)); +_([1, 2, 3]).chain() + .sortBy(x => -x) + .sortBy(x => -x) + .value().length; + _([1.3, 2.1, 2.4]).groupBy((e) => Math.floor(e)); _.groupBy([1.3, 2.1, 2.4], (num) => Math.floor(num).toString()); _.groupBy(['one', 'two', 'three'], 'length');