mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: signatures of _.toArray have been changed
This commit is contained in:
+26
-12
@@ -6255,15 +6255,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();
|
||||
}
|
||||
|
||||
{
|
||||
@@ -6272,22 +6270,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>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+23
-12
@@ -10320,12 +10320,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
|
||||
@@ -10335,12 +10330,7 @@ declare module _ {
|
||||
/**
|
||||
* @see _.toArray
|
||||
*/
|
||||
toArray<TValue>(value: TValue): any[];
|
||||
|
||||
/**
|
||||
* @see _.toArray
|
||||
*/
|
||||
toArray(value?: any): any[];
|
||||
toArray<TResult>(value?: any): TResult[];
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
@@ -10364,6 +10354,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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user