mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-15 12:42:26 +08:00
lodash: changed _.last() method
This commit is contained in:
1 parent
ffceea9dd1
commit
f0237f4199
2 files changed
+25
-8
No files matched your search
+11
-2
@@ -345,8 +345,17 @@ result = <number>_.indexOf([1, 1, 2, 2, 3, 3], 2, true);
|
||||
result = _(testIntersectionList).intersection<TResult>(testIntersectionList, testIntersectionArray).value();
|
||||
}
|
||||
|
||||
result = <number>_.last([1, 2, 3]);
|
||||
result = <number>_([1, 2, 3]).last();
|
||||
// _.last
|
||||
module TestLast {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let result: TResult;
|
||||
|
||||
result = _.last<TResult>(array);
|
||||
result = _.last<TResult>(list);
|
||||
result = _<TResult>(array).last();
|
||||
result = _(list).last<TResult>();
|
||||
}
|
||||
|
||||
result = <number>_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
|
||||
result = <number>_.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
||||
|
||||
Vendored
+14
-6
@@ -872,20 +872,28 @@ declare module _ {
|
||||
//_.last
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Gets the last element of an array.
|
||||
* @param array The array to query.
|
||||
* @return Returns the last element of array.
|
||||
**/
|
||||
last<T>(array: Array<T>): T;
|
||||
* Gets the last element of array.
|
||||
*
|
||||
* @param array The array to query.
|
||||
* @return Returns the last element of array.
|
||||
*/
|
||||
last<T>(array: List<T>): T;
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
**/
|
||||
*/
|
||||
last(): T;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last<T>(): T;
|
||||
}
|
||||
|
||||
//_.lastIndexOf
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user