lodash: signatures of the method _.propertyOf have been changed

This commit is contained in:
Ilya Mochalov
2015-11-02 04:37:28 +05:00
parent eb59a40d3c
commit 85bcbfab80
2 changed files with 34 additions and 7 deletions
+26 -7
View File
@@ -3711,15 +3711,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
@@ -10201,6 +10201,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.
*/
@@ -10214,6 +10215,13 @@ declare module _ {
propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.propertyOf
*/
propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
}
//_.range
interface LoDashStatic {
/**