diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f12ca23c4..ec18193f5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -300,35 +300,60 @@ module TestDropRightWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; - let result: TResult[]; - result = _.dropRightWhile(array); - result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, predicateFn, any); - result = _.dropRightWhile(array, ''); - result = _.dropRightWhile(array, '', any); - result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42}); + { + let result: TResult[]; - result = _.dropRightWhile(list); - result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, predicateFn, any); - result = _.dropRightWhile(list, ''); - result = _.dropRightWhile(list, '', any); - result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42}); + result = _.dropRightWhile(array); + result = _.dropRightWhile(array, predicateFn); + result = _.dropRightWhile(array, predicateFn, any); + result = _.dropRightWhile(array, ''); + result = _.dropRightWhile(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(list); + result = _.dropRightWhile(list, predicateFn); + result = _.dropRightWhile(list, predicateFn, any); + result = _.dropRightWhile(list, ''); + result = _.dropRightWhile(list, '', any); + result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42}); + } - result = _(list).dropRightWhile().value(); - result = _(list).dropRightWhile(predicateFn).value(); - result = _(list).dropRightWhile(predicateFn, any).value(); - result = _(list).dropRightWhile('').value(); - result = _(list).dropRightWhile('', any).value(); - result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}).value(); + { + let result: _.LoDashImplicitArrayWrapper; + + 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(); + result = _(list).dropRightWhile(predicateFn); + result = _(list).dropRightWhile(predicateFn, any); + result = _(list).dropRightWhile(''); + result = _(list).dropRightWhile('', any); + result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + 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(); + result = _(list).chain().dropRightWhile(predicateFn); + result = _(list).chain().dropRightWhile(predicateFn, any); + result = _(list).chain().dropRightWhile(''); + result = _(list).chain().dropRightWhile('', any); + result = _(list).chain().dropRightWhile<{a: number;}, TResult>({a: 42}); + } } // _.dropWhile diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 141ad993c..eae1cd884 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -527,6 +527,56 @@ declare module _ { ): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + //_.dropWhile interface LoDashStatic { /**