From e6ca97a0aa5cb933ee87ade1fb6fba3269cba8c3 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 18 Jul 2015 09:02:27 +0500 Subject: [PATCH] lodash: added _.valuesIn() method --- lodash/lodash-tests.ts | 12 ++++++++++++ lodash/lodash.d.ts | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3a1c51f18..5536e2d32 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1091,6 +1091,18 @@ result = <{ a: number; b: number; c: number; }>_.transform(<{ [index: string]: n result = _.values({ 'one': 1, 'two': 2, 'three': 3 }); +// _.valueIn +class TestValueIn { + public a = 1; + public b = 2; + public c: number; +} +TestValueIn.prototype.c = 3; +result = _.valuesIn(new TestValueIn()); +// → [1, 2, 3] +result = _(new TestValueIn()).valuesIn().value(); +// → [1, 2, 3] + /********** * Utilities * ***********/ diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index fcf468577..66d5bbd4f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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(object?: any): T[]; + } + + interface LoDashObjectWrapper { + /** + * @see _.valuesIn + **/ + valuesIn(): LoDashObjectWrapper; + } + /********** * String * **********/