Merge pull request #7552 from chrootsu/lodash-toArray

lodash: signatures of _.toArray have been changed
This commit is contained in:
Masahiro Wakame
2016-01-11 23:31:25 +09:00
2 changed files with 49 additions and 24 deletions
+26 -12
View File
@@ -7000,15 +7000,13 @@ module TestToArray {
let array: TResult[];
let list: _.List<TResult>;
let dictionary: _.Dictionary<TResult>;
let numericDictionary: _.NumericDictionary<TResult>;
{
let result: string[];
result = _.toArray<string>('');
result = _.toArray('');
result = (function (a: string) {return _.toArray<IArguments, string>(arguments);})('');
result = _((function (a: string) {return arguments;})('')).toArray<string>().value();
}
{
@@ -7017,22 +7015,38 @@ module TestToArray {
result = _.toArray<TResult>(array);
result = _.toArray<TResult>(list);
result = _.toArray<TResult>(dictionary);
result = _.toArray<TResult>(numericDictionary);
result = _(array).toArray().value();
result = _(list).toArray<TResult>().value();
result = _(dictionary).toArray<TResult>().value();
result = _.toArray(array);
result = _.toArray(list);
result = _.toArray(dictionary);
result = _.toArray(numericDictionary);
}
{
let result: any[];
result = _.toArray();
result = _.toArray<number>(42);
result = _.toArray<boolean>(true);
result = _.toArray(42);
result = _.toArray(true);
}
result = _('').toArray<string>().value();
result = _(42).toArray<any>().value();
result = _(true).toArray<any>().value();
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).toArray();
result = _(list).toArray<TResult>();
result = _(dictionary).toArray<TResult>();
result = _(numericDictionary).toArray<TResult>();
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().toArray();
result = _(list).chain().toArray<TResult>();
result = _(dictionary).chain().toArray<TResult>();
result = _(numericDictionary).chain().toArray<TResult>();
}
}
+23 -12
View File
@@ -10928,12 +10928,7 @@ declare module _ {
* @param value The value to convert.
* @return Returns the converted array.
*/
toArray(value: string): string[];
/**
* @see _.toArray
*/
toArray<T>(value: List<T>|Dictionary<T>): T[];
toArray<T>(value: List<T>|Dictionary<T>|NumericDictionary<T>): T[];
/**
* @see _.toArray
@@ -10943,12 +10938,7 @@ declare module _ {
/**
* @see _.toArray
*/
toArray<TValue>(value: TValue): any[];
/**
* @see _.toArray
*/
toArray(value?: any): any[];
toArray<TResult>(value?: any): TResult[];
}
interface LoDashImplicitWrapper<T> {
@@ -10972,6 +10962,27 @@ declare module _ {
toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.toArray
*/
toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.toArray
*/
toArray(): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.toArray
*/
toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
}
//_.toPlainObject
interface LoDashStatic {
/**