lodash: changed _.values() method

This commit is contained in:
Ilya Mochalov
2015-07-20 02:04:38 +05:00
parent db475daba2
commit 1b5177dc28
2 changed files with 21 additions and 4 deletions
+11 -1
View File
@@ -1092,7 +1092,17 @@ result = <{ a: number; b: number; c: number; }>_.transform(<{ [index: string]: n
r[key] = num * 3;
});
result = <number[]>_.values({ 'one': 1, 'two': 2, 'three': 3 });
// _.values
class TestValues {
public a = 1;
public b = 2;
public c: string;
}
TestValues.prototype.c = 'a';
result = <number[]>_.values<number>(new TestValues());
// → [1, 2] (iteration order is not guaranteed)
result = <number[]>_(new TestValues()).values<number>().value();
// → [1, 2] (iteration order is not guaranteed)
// _.valueIn
class TestValueIn {
+10 -3
View File
@@ -6301,11 +6301,18 @@ declare module _ {
//_.values
interface LoDashStatic {
/**
* Creates an array composed of the own enumerable property values of object.
* @param object The object to inspect.
* Creates an array of the own enumerable property values of object.
* @param object The object to query.
* @return Returns an array of property values.
**/
values(object?: any): any[];
values<T>(object?: any): T[];
}
interface LoDashObjectWrapper<T> {
/**
* @see _.values
**/
values<TResult>(): LoDashObjectWrapper<TResult[]>;
}
//_.valuesIn