mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #6568 from chrootsu/lodash-propertyOf
lodash: signatures of the method _.propertyOf have been changed
This commit is contained in:
+26
-7
@@ -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);
|
||||
|
||||
Vendored
+8
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user