diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d6d98230c..f7e0466dc 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -492,6 +492,16 @@ var greetPartial = function(greeting, name) { return greeting + ' ' + name; }; var hi = _.partial(greetPartial, 'hi'); hi('moe'); +var defaultsDeep = _.partialRight(_['merge'], _.defaults); + +var optionsPartialRight = { + 'variable': 'data', + 'imports': { 'jq': $ } +}; + +defaultsDeep(optionsPartialRight, _.templateSettings); + + //////////////////////////////////////////////////////////////////////////////////////// //WHAT'S LEFT //////////////////////////////////////////////////////////////////////////////////////// diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c27b5ca9c..cf6c0ecc2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1877,8 +1877,19 @@ declare module _ { * @return The new partially applied function. **/ export function partial( - fn: Function, - ...arguments: any[]): Function; + func: Function, + ...args: any[]): Function; + + /** + * This method is like _.partial except that partial arguments are appended to those provided + * to the new function. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + export function partialRight( + func: Function, + ...args: any[]): Function;