Merge pull request #6654 from chrootsu/lodash-takeRight

lodash: signatures of the method _.takeRight have been changed
This commit is contained in:
Masahiro Wakame
2015-11-11 19:00:41 +09:00
2 changed files with 48 additions and 13 deletions
+33 -12
View File
@@ -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
+15 -1
View File
@@ -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 {
/**