diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c36e211c2..c9c37c433 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -524,6 +524,10 @@ result = _.sortBy([1, 2, 3], function (num) { return Math.sin(num); }) result = _.sortBy([1, 2, 3], function (num) { return this.sin(num); }, Math); result = _.sortBy(['banana', 'strawberry', 'apple'], 'length'); +result = _([1, 2, 3]).sortBy(function (num) { return Math.sin(num); }).value(); +result = _([1, 2, 3]).sortBy(function (num) { return this.sin(num); }, Math).value(); +result = _(['banana', 'strawberry', 'apple']).sortBy('length').value(); + (function (a: number, b: number, c: number, d: number) { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); result = _.where(stoogesCombined, { 'age': 40 }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c3089b06a..e355330a0 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -4349,6 +4349,27 @@ declare module _ { whereValue: W): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.sortBy + **/ + sortBy( + callback?: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.sortBy + * @param pluckValue _.pluck style callback + **/ + sortBy(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.sortBy + * @param whereValue _.where style callback + **/ + sortBy(whereValue: W): LoDashArrayWrapper; + } + //_.toArray interface LoDashStatic { /**