diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 639cf8364..4dfaa33f1 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -7000,15 +7000,13 @@ module TestToArray { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; { let result: string[]; + result = _.toArray(''); result = _.toArray(''); - - result = (function (a: string) {return _.toArray(arguments);})(''); - - result = _((function (a: string) {return arguments;})('')).toArray().value(); } { @@ -7017,22 +7015,38 @@ module TestToArray { result = _.toArray(array); result = _.toArray(list); result = _.toArray(dictionary); + result = _.toArray(numericDictionary); - result = _(array).toArray().value(); - result = _(list).toArray().value(); - result = _(dictionary).toArray().value(); + result = _.toArray(array); + result = _.toArray(list); + result = _.toArray(dictionary); + result = _.toArray(numericDictionary); } { let result: any[]; result = _.toArray(); - result = _.toArray(42); - result = _.toArray(true); + result = _.toArray(42); + result = _.toArray(true); + } - result = _('').toArray().value(); - result = _(42).toArray().value(); - result = _(true).toArray().value(); + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).toArray(); + result = _(list).toArray(); + result = _(dictionary).toArray(); + result = _(numericDictionary).toArray(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().toArray(); + result = _(list).chain().toArray(); + result = _(dictionary).chain().toArray(); + result = _(numericDictionary).chain().toArray(); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index f8d42c958..5f0c07777 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10928,12 +10928,7 @@ declare module _ { * @param value The value to convert. * @return Returns the converted array. */ - toArray(value: string): string[]; - - /** - * @see _.toArray - */ - toArray(value: List|Dictionary): T[]; + toArray(value: List|Dictionary|NumericDictionary): T[]; /** * @see _.toArray @@ -10943,12 +10938,7 @@ declare module _ { /** * @see _.toArray */ - toArray(value: TValue): any[]; - - /** - * @see _.toArray - */ - toArray(value?: any): any[]; + toArray(value?: any): TResult[]; } interface LoDashImplicitWrapper { @@ -10972,6 +10962,27 @@ declare module _ { toArray(): LoDashImplicitArrayWrapper; } + interface LoDashExplicitWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + //_.toPlainObject interface LoDashStatic { /**