mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-28 12:43:06 +08:00
Add chainable definitions for _(...).toArray.
This commit is contained in:
@@ -556,7 +556,11 @@ result = <number[]>_([1, 2, 3]).sortBy(function (num) { return Math.sin(num); })
|
||||
result = <number[]>_([1, 2, 3]).sortBy(function (num) { return this.sin(num); }, Math).value();
|
||||
result = <string[]>_(['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<number> { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
|
||||
result = <number[]>_.toArray([1, 2, 3, 4]);
|
||||
(function (a: number, b: number, c: number, d: number): Array<number> { return _(arguments).toArray<number>().slice(1).value(); })(1, 2, 3, 4);
|
||||
result = <number[]>_([1,2,3,4]).toArray().value();
|
||||
|
||||
|
||||
result = <IStoogesCombined[]>_.where(stoogesCombined, { 'age': 40 });
|
||||
result = <IStoogesCombined[]>_.where(stoogesCombined, { 'quotes': ['Poifect!'] });
|
||||
|
||||
Vendored
+14
@@ -4520,6 +4520,20 @@ declare module _ {
|
||||
toArray<T>(collection: Dictionary<T>): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.toArray
|
||||
**/
|
||||
toArray(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toArray
|
||||
**/
|
||||
toArray<TValue>(): LoDashArrayWrapper<TValue>;
|
||||
}
|
||||
|
||||
//_.where
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user