mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-31 11:40:47 +08:00
Merge pull request #5286 from chrootsu/lodash-isMatch
lodash: added _.isMatch() method
This commit is contained in:
@@ -1060,6 +1060,15 @@ result = <boolean>_(1).gte(2);
|
||||
result = <boolean>_([]).gte(2);
|
||||
result = <boolean>_({}).gte(2);
|
||||
|
||||
// _.isMatch
|
||||
var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean;
|
||||
result = <boolean>_.isMatch({}, {});
|
||||
result = <boolean>_.isMatch({}, {}, testIsMatchCustiomizerFn);
|
||||
result = <boolean>_.isMatch({}, {}, testIsMatchCustiomizerFn, {});
|
||||
result = <boolean>_({}).isMatch({});
|
||||
result = <boolean>_({}).isMatch({}, testIsMatchCustiomizerFn);
|
||||
result = <boolean>_({}).isMatch({}, testIsMatchCustiomizerFn, {});
|
||||
|
||||
// _.lt
|
||||
result = <boolean>_.lt(1, 2);
|
||||
result = <boolean>_(1).lt(2);
|
||||
|
||||
Vendored
+27
@@ -5861,6 +5861,33 @@ declare module _ {
|
||||
gte(other: any): boolean;
|
||||
}
|
||||
|
||||
//_.isMatch
|
||||
interface isMatchCustomizer {
|
||||
(value: any, other: any, indexOrKey?: number|string): boolean;
|
||||
}
|
||||
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Performs a deep comparison between object and source to determine if object contains equivalent property
|
||||
* values. If customizer is provided it’s invoked to compare values. If customizer returns undefined
|
||||
* comparisons are handled by the method instead. The customizer is bound to thisArg and invoked with three
|
||||
* arguments: (value, other, index|key).
|
||||
* @param object The object to inspect.
|
||||
* @param source The object of property values to match.
|
||||
* @param customizer The function to customize value comparisons.
|
||||
* @param thisArg The this binding of customizer.
|
||||
* @return Returns true if object is a match, else false.
|
||||
*/
|
||||
isMatch(object: Object, source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.isMatch
|
||||
*/
|
||||
isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
|
||||
}
|
||||
|
||||
//_.lt
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user