lodash: signatures of the method _.dropRightWhile have been changed

This commit is contained in:
Ilya Mochalov
2015-11-04 14:37:13 +05:00
parent 0dd29bf825
commit a462ae3f0f
2 changed files with 100 additions and 25 deletions
+50 -25
View File
@@ -300,35 +300,60 @@ module TestDropRightWhile {
let array: TResult[];
let list: _.List<TResult>;
let predicateFn: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
let result: TResult[];
result = _.dropRightWhile<TResult>(array);
result = _.dropRightWhile<TResult>(array, predicateFn);
result = _.dropRightWhile<TResult>(array, predicateFn, any);
result = _.dropRightWhile<TResult>(array, '');
result = _.dropRightWhile<TResult>(array, '', any);
result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42});
{
let result: TResult[];
result = _.dropRightWhile<TResult>(list);
result = _.dropRightWhile<TResult>(list, predicateFn);
result = _.dropRightWhile<TResult>(list, predicateFn, any);
result = _.dropRightWhile<TResult>(list, '');
result = _.dropRightWhile<TResult>(list, '', any);
result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42});
result = _.dropRightWhile<TResult>(array);
result = _.dropRightWhile<TResult>(array, predicateFn);
result = _.dropRightWhile<TResult>(array, predicateFn, any);
result = _.dropRightWhile<TResult>(array, '');
result = _.dropRightWhile<TResult>(array, '', any);
result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42});
result = _(array).dropRightWhile().value();
result = _(array).dropRightWhile(predicateFn).value();
result = _(array).dropRightWhile(predicateFn, any).value();
result = _(array).dropRightWhile('').value();
result = _(array).dropRightWhile('', any).value();
result = _(array).dropRightWhile<{a: number;}>({a: 42}).value();
result = _.dropRightWhile<TResult>(list);
result = _.dropRightWhile<TResult>(list, predicateFn);
result = _.dropRightWhile<TResult>(list, predicateFn, any);
result = _.dropRightWhile<TResult>(list, '');
result = _.dropRightWhile<TResult>(list, '', any);
result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42});
}
result = _(list).dropRightWhile<TResult>().value();
result = _(list).dropRightWhile<TResult>(predicateFn).value();
result = _(list).dropRightWhile<TResult>(predicateFn, any).value();
result = _(list).dropRightWhile<TResult>('').value();
result = _(list).dropRightWhile<TResult>('', any).value();
result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}).value();
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).dropRightWhile();
result = _(array).dropRightWhile(predicateFn);
result = _(array).dropRightWhile(predicateFn, any);
result = _(array).dropRightWhile('');
result = _(array).dropRightWhile('', any);
result = _(array).dropRightWhile<{a: number;}>({a: 42});
result = _(list).dropRightWhile<TResult>();
result = _(list).dropRightWhile<TResult>(predicateFn);
result = _(list).dropRightWhile<TResult>(predicateFn, any);
result = _(list).dropRightWhile<TResult>('');
result = _(list).dropRightWhile<TResult>('', any);
result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42});
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().dropRightWhile();
result = _(array).chain().dropRightWhile(predicateFn);
result = _(array).chain().dropRightWhile(predicateFn, any);
result = _(array).chain().dropRightWhile('');
result = _(array).chain().dropRightWhile('', any);
result = _(array).chain().dropRightWhile<{a: number;}>({a: 42});
result = _(list).chain().dropRightWhile<TResult>();
result = _(list).chain().dropRightWhile<TResult>(predicateFn);
result = _(list).chain().dropRightWhile<TResult>(predicateFn, any);
result = _(list).chain().dropRightWhile<TResult>('');
result = _(list).chain().dropRightWhile<TResult>('', any);
result = _(list).chain().dropRightWhile<{a: number;}, TResult>({a: 42});
}
}
// _.dropWhile
+50
View File
@@ -527,6 +527,56 @@ declare module _ {
): LoDashImplicitArrayWrapper<TValue>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.dropRightWhile
*/
dropRightWhile(
predicate?: ListIterator<T, boolean>,
thisArg?: any
): LoDashExplicitArrayWrapper<T>;
/**
* @see _.dropRightWhile
*/
dropRightWhile(
predicate?: string,
thisArg?: any
): LoDashExplicitArrayWrapper<T>;
/**
* @see _.dropRightWhile
*/
dropRightWhile<TWhere>(
predicate?: TWhere
): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.dropRightWhile
*/
dropRightWhile<TValue>(
predicate?: ListIterator<TValue, boolean>,
thisArg?: any
): LoDashExplicitArrayWrapper<TValue>;
/**
* @see _.dropRightWhile
*/
dropRightWhile<TValue>(
predicate?: string,
thisArg?: any
): LoDashExplicitArrayWrapper<TValue>;
/**
* @see _.dropRightWhile
*/
dropRightWhile<TWhere, TValue>(
predicate?: TWhere
): LoDashExplicitArrayWrapper<TValue>;
}
//_.dropWhile
interface LoDashStatic {
/**