MCPcopy
hub / github.com/jestjs/jest / asymmetricMatch

Function asymmetricMatch

packages/expect-utils/src/jasmineUtils.ts:44–59  ·  view source on GitHub ↗
(a: any, b: any)

Source from the content-addressed store, hash-verified

42}
43
44function asymmetricMatch(a: any, b: any) {
45 const asymmetricA = isAsymmetric(a);
46 const asymmetricB = isAsymmetric(b);
47
48 if (asymmetricA && asymmetricB) {
49 return undefined;
50 }
51
52 if (asymmetricA) {
53 return a.asymmetricMatch(b);
54 }
55
56 if (asymmetricB) {
57 return b.asymmetricMatch(a);
58 }
59}
60
61// Equality function lovingly adapted from isEqual in
62// [Underscore](http://underscorejs.org)

Callers 1

eqFunction · 0.70

Calls 2

isAsymmetricFunction · 0.85
asymmetricMatchMethod · 0.45

Tested by

no test coverage detected