mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
added _(...).countBy defs
This commit is contained in:
@@ -284,6 +284,10 @@ result = <_.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return
|
||||
result = <_.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <_.Dictionary<number>>_.countBy(['one', 'two', 'three'], 'length');
|
||||
|
||||
result = <_.LoDashWrapper<_.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return Math.floor(num); });
|
||||
result = <_.LoDashWrapper<_.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return this.floor(num); }, Math);
|
||||
result = <_.LoDashWrapper<_.Dictionary<number>>>_(['one', 'two', 'three']).countBy('length');
|
||||
|
||||
result = <boolean>_.every([true, 1, null, 'yes'], Boolean);
|
||||
result = <boolean>_.every(stoogesAges, 'age');
|
||||
result = <boolean>_.every(stoogesAges, { 'age': 50 });
|
||||
|
||||
Vendored
+18
-1
@@ -1099,13 +1099,30 @@ declare module _ {
|
||||
|
||||
/**
|
||||
* @see _.countBy
|
||||
* @param iterator Function name
|
||||
* @param callback Function name
|
||||
**/
|
||||
export function countBy<T>(
|
||||
collection: Collection<T>,
|
||||
callback: string,
|
||||
thisArg?: any): Dictionary<number>;
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.countBy
|
||||
**/
|
||||
countBy<T>(
|
||||
callback?: ListIterator<T, any>,
|
||||
thisArg?: any): LoDashWrapper<Dictionary<number>>;
|
||||
|
||||
/**
|
||||
* @see _.countBy
|
||||
* @param callback Function name
|
||||
**/
|
||||
countBy<T>(
|
||||
callback: string,
|
||||
thisArg?: any): LoDashWrapper<Dictionary<number>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given callback returns truey value for all elements of a collection.
|
||||
* The callback is bound to thisArg and invoked with three arguments; (value, index|key,
|
||||
|
||||
Reference in New Issue
Block a user