mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge pull request #4982 from chrootsu/lodash-values
lodash: changed _.values() method
This commit is contained in:
@@ -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 {
|
||||
|
||||
13
lodash/lodash.d.ts
vendored
13
lodash/lodash.d.ts
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user