From 674a7033d617dff421b631e7acf7fd4f04bc8a5c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 23 May 2019 08:24:48 -0700 Subject: [PATCH] Add most components of ListIteratee to Collection.orderBy (#35667) [PropertyName, any] breaks contextual typing of ListIterator, so I left it out. --- types/lodash/ts3.1/common/collection.d.ts | 4 ++-- types/lodash/ts3.1/lodash-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/lodash/ts3.1/common/collection.d.ts b/types/lodash/ts3.1/common/collection.d.ts index ee5f6191c9..6aea8f892f 100644 --- a/types/lodash/ts3.1/common/collection.d.ts +++ b/types/lodash/ts3.1/common/collection.d.ts @@ -1342,7 +1342,7 @@ declare module "../index" { /** * @see _.orderBy */ - orderBy(iteratees?: Many>, orders?: Many): Collection; + orderBy(iteratees?: Many | PropertyName | PartialDeep>, orders?: Many): Collection; } interface Object { /** @@ -1354,7 +1354,7 @@ declare module "../index" { /** * @see _.orderBy */ - orderBy(iteratees?: Many>, orders?: Many): CollectionChain; + orderBy(iteratees?: Many | PropertyName | PartialDeep>, orders?: Many): CollectionChain; } interface ObjectChain { /** diff --git a/types/lodash/ts3.1/lodash-tests.ts b/types/lodash/ts3.1/lodash-tests.ts index e8b9eeacfa..3d33ecc656 100644 --- a/types/lodash/ts3.1/lodash-tests.ts +++ b/types/lodash/ts3.1/lodash-tests.ts @@ -3161,7 +3161,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain _.orderBy("acbd", [(value) => 1, (value) => 2], [true, false]); // $ExpectType string[] _.orderBy(list, (value) => 1); // $ExpectType AbcObject[] _.orderBy(list, (value) => 1, true); // $ExpectType AbcObject[] - _.orderBy(list, [(value) => 1, (value) => 2], [true, false]); // $ExpectType AbcObject[] + _.orderBy(list, [(value) => 1, 'third', (value) => 2], [true, false]); // $ExpectType AbcObject[] _.orderBy(dictionary, (value) => 1); // $ExpectType AbcObject[] _.orderBy(dictionary, (value) => 1, true); // $ExpectType AbcObject[] _.orderBy(numericDictionary, (value) => 1); // $ExpectType AbcObject[] @@ -3177,7 +3177,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain _.chain(list).orderBy((value) => 1); // $ExpectType CollectionChain _.chain(list).orderBy((value) => 1, true); // $ExpectType CollectionChain - _.chain(list).orderBy([(value) => 1, (value) => 2], true); // $ExpectType CollectionChain + _.chain(list).orderBy([(value) => 1, 'third', (value) => 2], true); // $ExpectType CollectionChain _.chain(dictionary).orderBy((value) => 1); // $ExpectType CollectionChain _.chain(dictionary).orderBy((value) => 1, true); // $ExpectType CollectionChain _.chain(numericDictionary).orderBy((value) => 1); // $ExpectType CollectionChain