mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
Merge pull request #6654 from chrootsu/lodash-takeRight
lodash: signatures of the method _.takeRight have been changed
This commit is contained in:
+33
-12
@@ -1151,18 +1151,39 @@ module TestTake {
|
||||
}
|
||||
|
||||
// _.takeRight
|
||||
{
|
||||
let testTakeRightArray: TResult[];
|
||||
let testTakeRightList: _.List<TResult>;
|
||||
let result: TResult[];
|
||||
result = _.takeRight<TResult>(testTakeRightArray);
|
||||
result = _.takeRight<TResult>(testTakeRightArray, 42);
|
||||
result = _.takeRight<TResult>(testTakeRightList);
|
||||
result = _.takeRight<TResult>(testTakeRightList, 42);
|
||||
result = _(testTakeRightArray).takeRight().value();
|
||||
result = _(testTakeRightArray).takeRight(42).value();
|
||||
result = _(testTakeRightList).takeRight<TResult>().value();
|
||||
result = _(testTakeRightList).takeRight<TResult>(42).value();
|
||||
module TestTakeRight {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.takeRight<TResult>(array);
|
||||
result = _.takeRight<TResult>(array, 42);
|
||||
|
||||
result = _.takeRight<TResult>(list);
|
||||
result = _.takeRight<TResult>(list, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).takeRight();
|
||||
result = _(array).takeRight(42);
|
||||
|
||||
result = _(list).takeRight<TResult>();
|
||||
result = _(list).takeRight<TResult>(42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).chain().takeRight();
|
||||
result = _(array).chain().takeRight(42);
|
||||
|
||||
result = _(list).chain().takeRight<TResult>();
|
||||
result = _(list).chain().takeRight<TResult>(42);
|
||||
}
|
||||
}
|
||||
|
||||
// _.takeRightWhile
|
||||
|
||||
Vendored
+15
-1
@@ -1994,7 +1994,7 @@ declare module _ {
|
||||
* @return Returns the slice of array.
|
||||
*/
|
||||
takeRight<T>(
|
||||
array: T[]|List<T>,
|
||||
array: List<T>,
|
||||
n?: number
|
||||
): T[];
|
||||
}
|
||||
@@ -2013,6 +2013,20 @@ declare module _ {
|
||||
takeRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.takeRight
|
||||
*/
|
||||
takeRight(n?: number): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.takeRight
|
||||
*/
|
||||
takeRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.takeRightWhile
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user