mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-28 12:43:06 +08:00
lodash: added _.valuesIn() method
This commit is contained in:
@@ -1091,6 +1091,18 @@ result = <{ a: number; b: number; c: number; }>_.transform(<{ [index: string]: n
|
||||
|
||||
result = <number[]>_.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
|
||||
// _.valueIn
|
||||
class TestValueIn {
|
||||
public a = 1;
|
||||
public b = 2;
|
||||
public c: number;
|
||||
}
|
||||
TestValueIn.prototype.c = 3;
|
||||
result = <number[]>_.valuesIn<number>(new TestValueIn());
|
||||
// → [1, 2, 3]
|
||||
result = <number[]>_(new TestValueIn()).valuesIn<number>().value();
|
||||
// → [1, 2, 3]
|
||||
|
||||
/**********
|
||||
* Utilities *
|
||||
***********/
|
||||
|
||||
Vendored
+17
@@ -6291,6 +6291,23 @@ declare module _ {
|
||||
values(object?: any): any[];
|
||||
}
|
||||
|
||||
//_.valuesIn
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable property values of object.
|
||||
* @param object The object to query.
|
||||
* @return Returns the array of property values.
|
||||
**/
|
||||
valuesIn<T>(object?: any): T[];
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.valuesIn
|
||||
**/
|
||||
valuesIn<TResult>(): LoDashObjectWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
/**********
|
||||
* String *
|
||||
**********/
|
||||
|
||||
Reference in New Issue
Block a user