added _(...).defaults defs

This commit is contained in:
Brian Zengel
2013-10-21 01:02:22 -04:00
parent 48b80da5d0
commit 7b747b7f29
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -627,6 +627,7 @@ var result = <any>_.cloneDeep(stoogesAges, function(value) {
var foodDefaults = { 'name': 'apple' };
result = <any>_.defaults(foodDefaults, { 'name': 'banana', 'type': 'fruit' });
result = <any>_(foodDefaults).defaults({ 'name': 'banana', 'type': 'fruit' });
result = <string>_.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
return num % 2 == 0;
+7
View File
@@ -2677,6 +2677,13 @@ declare module _ {
object: any,
...sources: any[]): any;
interface LoDashWrapper<T> {
/**
* @see _.defaults
**/
defaults(...sources: any[]): LoDashWrapper<any>
}
/**
* This method is like _.findIndex except that it returns the key of the first element that
* passes the callback check, instead of the element itself.