Merge pull request #6530 from chrootsu/lodash-dropRight

lodash: signatures of the method _.dropRight changed
This commit is contained in:
Masahiro Wakame
2015-11-02 23:04:59 +09:00
2 changed files with 45 additions and 9 deletions
+31 -9
View File
@@ -262,15 +262,37 @@ module TestDifference {
module TestDropRight {
let array: TResult[];
let list: _.List<TResult>;
let result: TResult[];
result = _.dropRight<TResult>(array);
result = _.dropRight<TResult>(array, 42);
result = _.dropRight<TResult>(list);
result = _.dropRight<TResult>(list, 42);
result = _(array).dropRight().value();
result = _(array).dropRight(42).value();
result = _(list).dropRight<TResult>().value();
result = _(list).dropRight<TResult>(42).value();
{
let result: TResult[];
result = _.dropRight<TResult>(array);
result = _.dropRight<TResult>(array, 42);
result = _.dropRight<TResult>(list);
result = _.dropRight<TResult>(list, 42);
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).dropRight();
result = _(array).dropRight(42);
result = _(list).dropRight<TResult>();
result = _(list).dropRight<TResult>(42);
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().dropRight();
result = _(array).chain().dropRight(42);
result = _(list).chain().dropRight<TResult>();
result = _(list).chain().dropRight<TResult>(42);
}
}
// _.dropRightWhile
+14
View File
@@ -419,6 +419,20 @@ declare module _ {
dropRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.dropRight
*/
dropRight(n?: number): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.dropRight
*/
dropRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
}
//_.dropRightWhile
interface LoDashStatic {
/**