mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Merge pull request #4640 from nfantone/lodash/sample-arraywrapper
Add sample() to LoDashArrayWrapper interface
This commit is contained in:
@@ -605,6 +605,8 @@ result = <IFoodCombined[]>_(foodsCombined).reject({ 'type': 'fruit' }).value();
|
||||
|
||||
result = <number>_.sample([1, 2, 3, 4]);
|
||||
result = <number[]>_.sample([1, 2, 3, 4], 2);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).sample();
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).sample(2);
|
||||
|
||||
result = <number[]>_.shuffle([1, 2, 3, 4, 5, 6]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).shuffle();
|
||||
|
||||
Vendored
+13
-1
@@ -22,7 +22,7 @@ declare module _ {
|
||||
* forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
|
||||
* indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
|
||||
* object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
|
||||
* remove, rest, reverse, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
|
||||
* remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
|
||||
* toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip
|
||||
*
|
||||
* The non-chainable wrapper functions are:
|
||||
@@ -4559,6 +4559,18 @@ declare module _ {
|
||||
sample<T>(collection: Dictionary<T>, n: number): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.sample
|
||||
**/
|
||||
sample(n: number): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sample
|
||||
**/
|
||||
sample(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.shuffle
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user