lodash: added _.valuesIn() method

This commit is contained in:
Ilya Mochalov
2015-07-19 09:28:17 +05:00
parent c0fdc8f774
commit e6ca97a0aa
2 changed files with 29 additions and 0 deletions
+12
View File
@@ -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 *
***********/
+17
View File
@@ -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 *
**********/