Merge pull request #4460 from samalbert/feature/_.get_lodash

Added _.get definition to lodash with updated test file.
This commit is contained in:
Masahiro Wakame
2015-05-31 09:54:23 -07:00
2 changed files with 18 additions and 0 deletions
+2
View File
@@ -922,6 +922,8 @@ result = <string[]>_.methods(_);
result = <_.LoDashArrayWrapper<string>>_(_).functions();
result = <_.LoDashArrayWrapper<string>>_(_).methods();
result = <number>_.get({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
result = <boolean>_.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
interface FirstSecond {
+16
View File
@@ -5836,6 +5836,22 @@ declare module _ {
methods(): _.LoDashArrayWrapper<string>;
}
//_.get
interface LoDashStatic {
/**
* Gets the property value at path of object. If the resolved
* value is undefined the defaultValue is used in its place.
* @param object The object to query.
* @param path The path of the property to get.
* @param defaultValue The value returned if the resolved value is undefined.
* @return Returns the resolved value.
**/
get<T>(object : Object,
path:string|string[],
defaultValue?:T
): T;
}
//_.has
interface LoDashStatic {
/**