mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
@@ -139,6 +139,15 @@ result = <_.Dictionary<string>>_(<{ [index: string]: string; }>{ 'key1': 'test1'
|
||||
// /*************
|
||||
// * Arrays *
|
||||
// *************/
|
||||
result = <any[][]>_.chunk([1, '2', '3', false]);
|
||||
result = <_.LoDashArrayWrapper<any>>_([1, '2', '3', false]).chunk();
|
||||
result = <any[][]>_.chunk([1, '2', '3', false], 2);
|
||||
result = <_.LoDashArrayWrapper<any>>_([1, '2', '3', false]).chunk(2);
|
||||
result = <number[][]>_.chunk([1, 2, 3, 4]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).chunk();
|
||||
result = <number[][]>_.chunk([1, 2, 3, 4], 2);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).chunk(2);
|
||||
|
||||
result = <any[]>_.compact([0, 1, false, 2, '', 3]);
|
||||
result = <_.LoDashArrayWrapper<any>>_([0, 1, false, 2, '', 3]).compact();
|
||||
|
||||
|
||||
Vendored
+25
-1
@@ -17,7 +17,7 @@ declare module _ {
|
||||
* explicitly included in the build.
|
||||
*
|
||||
* The chainable wrapper functions are:
|
||||
* after, assign, bind, bindAll, bindKey, chain, compact, compose, concat, countBy,
|
||||
* after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
|
||||
* createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
|
||||
* forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
|
||||
* indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
|
||||
@@ -254,6 +254,30 @@ declare module _ {
|
||||
/*********
|
||||
* Arrays *
|
||||
**********/
|
||||
|
||||
//_.chunk
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of elements split into groups the length of size. If collection can’t be
|
||||
* split evenly, the final chunk will be the remaining elements.
|
||||
* @param array The array to process.
|
||||
* @param size The length of each chunk.
|
||||
* @return Returns the new array containing chunks.
|
||||
**/
|
||||
chunk<T>(array: Array<T>, size?: number): T[][];
|
||||
|
||||
/**
|
||||
* @see _.chunk
|
||||
**/
|
||||
chunk<T>(array: List<T>, size?: number): T[][];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.chunk
|
||||
**/
|
||||
chunk(size?: number): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.compact
|
||||
interface LoDashStatic {
|
||||
|
||||
Reference in New Issue
Block a user