Merge pull request #5286 from chrootsu/lodash-isMatch

lodash: added _.isMatch() method
This commit is contained in:
Masahiro Wakame
2015-08-13 23:12:04 +09:00
2 changed files with 36 additions and 0 deletions
+9
View File
@@ -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);
+27
View File
@@ -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 its 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 {
/**