mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Merge pull request #6025 from chrootsu/lodash-matches
lodash: added _.matches() method
This commit is contained in:
@@ -2439,6 +2439,23 @@ result = <() => {}>_({}).constant<{}>();
|
||||
result = _({}).iteratee(any).value();
|
||||
}
|
||||
|
||||
// _.matches
|
||||
module TestMatches {
|
||||
let source: TResult;
|
||||
|
||||
{
|
||||
let result: (value: any) => boolean;
|
||||
result = _.matches<TResult>(source);
|
||||
result = _(source).matches().value();
|
||||
}
|
||||
|
||||
{
|
||||
let result: (value: TResult) => boolean;
|
||||
result = _.matches<TResult, TResult>(source);
|
||||
result = _(source).matches<TResult>().value();
|
||||
}
|
||||
}
|
||||
|
||||
// _.method
|
||||
class TestMethod {
|
||||
a = {
|
||||
|
||||
Vendored
+32
@@ -8423,6 +8423,38 @@ declare module _ {
|
||||
iteratee<TResult>(thisArg?: any): LoDashObjectWrapper<(...args: any[]) => TResult>;
|
||||
}
|
||||
|
||||
//_.matches
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates a function that performs a deep comparison between a given object and source, returning true if the
|
||||
* given object has equivalent property values, else false.
|
||||
*
|
||||
* Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
|
||||
* strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own
|
||||
* or inherited property value see _.matchesProperty.
|
||||
*
|
||||
* @param source The object of property values to match.
|
||||
* @return Returns the new function.
|
||||
*/
|
||||
matches<T>(
|
||||
source: T
|
||||
): (value: any) => boolean;
|
||||
|
||||
/**
|
||||
* @see _.matches
|
||||
*/
|
||||
matches<T, V>(
|
||||
source: T
|
||||
): (value: V) => boolean;
|
||||
}
|
||||
|
||||
interface LoDashWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.matches
|
||||
*/
|
||||
matches<V>(): LoDashObjectWrapper<(value: V) => boolean>;
|
||||
}
|
||||
|
||||
//_.method
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user