From 1b5177dc28ba7ffe73ac9519f806870c21919995 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Mon, 20 Jul 2015 02:01:19 +0500 Subject: [PATCH] lodash: changed _.values() method --- lodash/lodash-tests.ts | 12 +++++++++++- lodash/lodash.d.ts | 13 ++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 985ef1efc2..9b4548502b 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1092,7 +1092,17 @@ result = <{ a: number; b: number; c: number; }>_.transform(<{ [index: string]: n r[key] = num * 3; }); -result = _.values({ 'one': 1, 'two': 2, 'three': 3 }); +// _.values +class TestValues { + public a = 1; + public b = 2; + public c: string; +} +TestValues.prototype.c = 'a'; +result = _.values(new TestValues()); +// → [1, 2] (iteration order is not guaranteed) +result = _(new TestValues()).values().value(); +// → [1, 2] (iteration order is not guaranteed) // _.valueIn class TestValueIn { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 31625a16b4..f02a4aa970 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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(object?: any): T[]; + } + + interface LoDashObjectWrapper { + /** + * @see _.values + **/ + values(): LoDashObjectWrapper; } //_.valuesIn