diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d58368b79..bc3727192 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -556,7 +556,11 @@ result = _([1, 2, 3]).sortBy(function (num) { return Math.sin(num); }) 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); +(function (a: number, b: number, c: number, d: number): Array { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); +result = _.toArray([1, 2, 3, 4]); +(function (a: number, b: number, c: number, d: number): Array { return _(arguments).toArray().slice(1).value(); })(1, 2, 3, 4); +result = _([1,2,3,4]).toArray().value(); + result = _.where(stoogesCombined, { 'age': 40 }); result = _.where(stoogesCombined, { 'quotes': ['Poifect!'] }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index e51a59825..e198ebc57 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -4520,6 +4520,20 @@ declare module _ { toArray(collection: Dictionary): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.toArray + **/ + toArray(): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.toArray + **/ + toArray(): LoDashArrayWrapper; + } + //_.where interface LoDashStatic { /**