Merge pull request #6914 from chrootsu/lodash-at

lodash: signatures of _.at have been changed
This commit is contained in:
Masahiro Wakame 2015-11-27 00:59:45 +09:00
commit 87d9fa607f
2 changed files with 45 additions and 14 deletions

View File

@ -2557,17 +2557,34 @@ module TestAny {
}
// _.at
{
let testAtArray: TResult[];
let testAtList: _.List<TResult>;
let testAtDictionary: _.Dictionary<TResult>;
let result: TResult[];
result = _.at<TResult>(testAtArray, 0, '1', [2], ['3'], [4, '5']);
result = _.at<TResult>(testAtList, 0, '1', [2], ['3'], [4, '5']);
result = _.at<TResult>(testAtDictionary, 0, '1', [2], ['3'], [4, '5']);
result = _(testAtArray).at(0, '1', [2], ['3'], [4, '5']).value();
result = _(testAtList).at<TResult>(0, '1', [2], ['3'], [4, '5']).value();
result = _(testAtDictionary).at<TResult>(0, '1', [2], ['3'], [4, '5']).value();
module TestAt {
let array: TResult[];
let list: _.List<TResult>;
let dictionary: _.Dictionary<TResult>;
{
let result: TResult[];
result = _.at<TResult>(array, 0, '1', [2], ['3'], [4, '5']);
result = _.at<TResult>(list, 0, '1', [2], ['3'], [4, '5']);
result = _.at<TResult>(dictionary, 0, '1', [2], ['3'], [4, '5']);
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).at(0, '1', [2], ['3'], [4, '5']);
result = _(list).at<TResult>(0, '1', [2], ['3'], [4, '5']);
result = _(dictionary).at<TResult>(0, '1', [2], ['3'], [4, '5']);
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']);
result = _(list).chain().at<TResult>(0, '1', [2], ['3'], [4, '5']);
result = _(dictionary).chain().at<TResult>(0, '1', [2], ['3'], [4, '5']);
}
}
// _.collect

20
lodash/lodash.d.ts vendored
View File

@ -3793,7 +3793,7 @@ declare module _ {
*/
at<T>(
collection: List<T>|Dictionary<T>,
...props: Array<number|string|Array<number|string>>
...props: (number|string|(number|string)[])[]
): T[];
}
@ -3801,14 +3801,28 @@ declare module _ {
/**
* @see _.at
*/
at(...props: Array<number|string|Array<number|string>>): LoDashImplicitArrayWrapper<T>;
at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.at
*/
at<TResult>(...props: Array<number|string|Array<number|string>>): LoDashImplicitArrayWrapper<TResult>;
at<T>(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.at
*/
at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.at
*/
at<T>(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
}
//_.collect