_(...).max, min

This commit is contained in:
motemen
2014-10-18 18:08:20 +09:00
parent 3653640a60
commit 824029abf4
2 changed files with 52 additions and 0 deletions
+6
View File
@@ -476,10 +476,16 @@ result = <IStoogesAge[]>_(stoogesAges).collect('name').value();
result = <number>_.max([4, 2, 8, 6]);
result = <IStoogesAge>_.max(stoogesAges, function (stooge) { return stooge.age; });
result = <IStoogesAge>_.max(stoogesAges, 'age');
result = <_.LoDashWrapper<number>>_([4, 2, 8, 6]).max();
result = <_.LoDashWrapper<IStoogesAge>>_(stoogesAges).max(function (stooge) { return stooge.age; });
result = <_.LoDashWrapper<IStoogesAge>>_(stoogesAges).max('age');
result = <number>_.min([4, 2, 8, 6]);
result = <IStoogesAge>_.min(stoogesAges, function (stooge) { return stooge.age; });
result = <IStoogesAge>_.min(stoogesAges, 'age');
result = <_.LoDashWrapper<number>>_([4, 2, 8, 6]).min();
result = <_.LoDashWrapper<IStoogesAge>>_(stoogesAges).min(function (stooge) { return stooge.age; });
result = <_.LoDashWrapper<IStoogesAge>>_(stoogesAges).min('age');
result = <string[]>_.pluck(stoogesAges, 'name');
result = <string[]>_(stoogesAges).pluck('name').value();
+46
View File
@@ -3654,6 +3654,29 @@ declare module _ {
whereValue: W): T;
}
interface LoDashArrayWrapper<T> {
/**
* @see _.max
**/
max(
callback?: ListIterator<T, any>,
thisArg?: any): LoDashWrapper<T>;
/**
* @see _.max
* @param pluckValue _.pluck style callback
**/
max(
pluckValue: string): LoDashWrapper<T>;
/**
* @see _.max
* @param whereValue _.where style callback
**/
max<W>(
whereValue: W): LoDashWrapper<T>;
}
//_.min
interface LoDashStatic {
/**
@@ -3742,6 +3765,29 @@ declare module _ {
whereValue: W): T;
}
interface LoDashArrayWrapper<T> {
/**
* @see _.min
**/
min(
callback?: ListIterator<T, any>,
thisArg?: any): LoDashWrapper<T>;
/**
* @see _.min
* @param pluckValue _.pluck style callback
**/
min(
pluckValue: string): LoDashWrapper<T>;
/**
* @see _.min
* @param whereValue _.where style callback
**/
min<W>(
whereValue: W): LoDashWrapper<T>;
}
//_.pluck
interface LoDashStatic {
/**