Merge pull request #6568 from chrootsu/lodash-propertyOf

lodash: signatures of the method _.propertyOf have been changed
This commit is contained in:
Masahiro Wakame
2015-11-02 23:41:34 +09:00
2 changed files with 34 additions and 7 deletions
+26 -7
View File
@@ -4205,15 +4205,34 @@ result = <number>(_('a.b').property<TestPropertyObject, number>().value())(testP
result = <number>(_(['a', 'b']).property<TestPropertyObject, number>().value())(testPropertyObject);
// _.propertyOf
interface TestPropertyOfObject {
a: {
b: number[];
module TestPropertyOf {
interface SampleObject {
a: {
b: number[];
}
}
let object: SampleObject;
{
let result: (path: string|string[]) => any;
result = _.propertyOf({});
result = _.propertyOf<SampleObject>(object);
}
{
let result: _.LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
result = _({}).propertyOf();
}
{
let result: _.LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
result = _({}).chain().propertyOf();
}
}
var testPropertyOfObject: TestPropertyOfObject;
result = <(path: string|string[]) => any>_.propertyOf({});
result = <(path: string|string[]) => any>_.propertyOf<TestPropertyOfObject>(testPropertyOfObject);
result = <(path: string|string[]) => any>_({}).propertyOf().value();
// _.range
result = <number[]>_.range(10);
+8
View File
@@ -10747,6 +10747,7 @@ declare module _ {
/**
* The opposite of _.property; this method creates a function that returns the property value at a given path
* on object.
*
* @param object The object to query.
* @return Returns the new function.
*/
@@ -10760,6 +10761,13 @@ declare module _ {
propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.propertyOf
*/
propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
}
//_.range
interface LoDashStatic {
/**