From 824029abf47d9cca8700aa0e72f90de2e689e9b1 Mon Sep 17 00:00:00 2001 From: motemen Date: Sat, 18 Oct 2014 18:04:12 +0900 Subject: [PATCH] _(...).max, min --- lodash/lodash-tests.ts | 6 ++++++ lodash/lodash.d.ts | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8fce20bb6..2d6335d70 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -476,10 +476,16 @@ result = _(stoogesAges).collect('name').value(); result = _.max([4, 2, 8, 6]); result = _.max(stoogesAges, function (stooge) { return stooge.age; }); result = _.max(stoogesAges, 'age'); +result = <_.LoDashWrapper>_([4, 2, 8, 6]).max(); +result = <_.LoDashWrapper>_(stoogesAges).max(function (stooge) { return stooge.age; }); +result = <_.LoDashWrapper>_(stoogesAges).max('age'); result = _.min([4, 2, 8, 6]); result = _.min(stoogesAges, function (stooge) { return stooge.age; }); result = _.min(stoogesAges, 'age'); +result = <_.LoDashWrapper>_([4, 2, 8, 6]).min(); +result = <_.LoDashWrapper>_(stoogesAges).min(function (stooge) { return stooge.age; }); +result = <_.LoDashWrapper>_(stoogesAges).min('age'); result = _.pluck(stoogesAges, 'name'); result = _(stoogesAges).pluck('name').value(); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index de604d818..85a406e38 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -3654,6 +3654,29 @@ declare module _ { whereValue: W): T; } + interface LoDashArrayWrapper { + /** + * @see _.max + **/ + max( + callback?: ListIterator, + thisArg?: any): LoDashWrapper; + + /** + * @see _.max + * @param pluckValue _.pluck style callback + **/ + max( + pluckValue: string): LoDashWrapper; + + /** + * @see _.max + * @param whereValue _.where style callback + **/ + max( + whereValue: W): LoDashWrapper; + } + //_.min interface LoDashStatic { /** @@ -3742,6 +3765,29 @@ declare module _ { whereValue: W): T; } + interface LoDashArrayWrapper { + /** + * @see _.min + **/ + min( + callback?: ListIterator, + thisArg?: any): LoDashWrapper; + + /** + * @see _.min + * @param pluckValue _.pluck style callback + **/ + min( + pluckValue: string): LoDashWrapper; + + /** + * @see _.min + * @param whereValue _.where style callback + **/ + min( + whereValue: W): LoDashWrapper; + } + //_.pluck interface LoDashStatic { /**