mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.partialRight definition
This commit is contained in:
@@ -492,6 +492,16 @@ var greetPartial = function(greeting, name) { return greeting + ' ' + name; };
|
||||
var hi = <Function>_.partial(greetPartial, 'hi');
|
||||
hi('moe');
|
||||
|
||||
var defaultsDeep = <Function>_.partialRight(_['merge'], _.defaults);
|
||||
|
||||
var optionsPartialRight = {
|
||||
'variable': 'data',
|
||||
'imports': { 'jq': $ }
|
||||
};
|
||||
|
||||
defaultsDeep(optionsPartialRight, _.templateSettings);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
//WHAT'S LEFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+13
-2
@@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user