diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 5d4268e09..0cff2693c 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1060,6 +1060,15 @@ result = _(1).gte(2); result = _([]).gte(2); result = _({}).gte(2); +// _.isMatch +var testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; +result = _.isMatch({}, {}); +result = _.isMatch({}, {}, testIsMatchCustiomizerFn); +result = _.isMatch({}, {}, testIsMatchCustiomizerFn, {}); +result = _({}).isMatch({}); +result = _({}).isMatch({}, testIsMatchCustiomizerFn); +result = _({}).isMatch({}, testIsMatchCustiomizerFn, {}); + // _.lt result = _.lt(1, 2); result = _(1).lt(2); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 4891fddf7..053e041a4 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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 { + /** + * @see _.isMatch + */ + isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean; + } + //_.lt interface LoDashStatic { /**