lodash: _.overEvery and _.overSome added

This commit is contained in:
Ilya Mochalov
2016-01-26 04:09:36 +05:00
parent 7b3d5a6ea5
commit 3d77d34ed8
2 changed files with 140 additions and 0 deletions

View File

@@ -9911,6 +9911,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
lodash/lodash.d.ts vendored
View File

@@ -16235,6 +16235,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 {
/**