Merge pull request #7795 from chrootsu/lodash-over

lodash: _.overEvery and _.overSome added
This commit is contained in:
Masahiro Wakame
2016-01-27 23:34:23 +09:00
2 changed files with 140 additions and 0 deletions
+60
View File
@@ -9972,6 +9972,66 @@ namespace TestOver {
}
}
// _.overEvery
namespace TestOverEvery {
{
let result: (...args: any[]) => boolean;
result = _.overEvery(() => true);
result = _.overEvery(() => true, () => true);
result = _.overEvery([() => true]);
result = _.overEvery([() => true], [() => true]);
}
{
let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).overEvery();
result = _(Math.max).overEvery(() => true);
result = _([Math.max]).overEvery();
result = _([Math.max]).overEvery([() => true]);
}
{
let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).chain().overEvery();
result = _(Math.max).chain().overEvery(() => true);
result = _([Math.max]).chain().overEvery();
result = _([Math.max]).chain().overEvery([() => true]);
}
}
// _.overSome
namespace TestOverSome {
{
let result: (...args: any[]) => boolean;
result = _.overSome(() => true);
result = _.overSome(() => true, () => true);
result = _.overSome([() => true]);
result = _.overSome([() => true], [() => true]);
}
{
let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).overSome();
result = _(Math.max).overSome(() => true);
result = _([Math.max]).overSome();
result = _([Math.max]).overSome([() => true]);
}
{
let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
result = _(Math.max).chain().overSome();
result = _(Math.max).chain().overSome(() => true);
result = _([Math.max]).chain().overSome();
result = _([Math.max]).chain().overSome([() => true]);
}
}
// _.property
module TestProperty {
interface SampleObject {
+80
View File
@@ -16347,6 +16347,86 @@ declare module _ {
over<TResult>(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>;
}
//_.overEvery
interface LoDashStatic {
/**
* Creates a function that checks if all of the predicates return truthy when invoked with the arguments
* provided to the created function.
*
* @param predicates The predicates to check.
* @return Returns the new function.
*/
overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean;
}
interface LoDashImplicitArrayWrapper<T> {
/**
* @see _.overEvery
*/
overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.overEvery
*/
overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.overEvery
*/
overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.overEvery
*/
overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
}
//_.overSome
interface LoDashStatic {
/**
* Creates a function that checks if any of the predicates return truthy when invoked with the arguments
* provided to the created function.
*
* @param predicates The predicates to check.
* @return Returns the new function.
*/
overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean;
}
interface LoDashImplicitArrayWrapper<T> {
/**
* @see _.overSome
*/
overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.overSome
*/
overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.overSome
*/
overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.overSome
*/
overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
}
//_.property
interface LoDashStatic {
/**