(obj: any, seen: Set<any> = new Set())
| 50 | } |
| 51 | |
| 52 | export function hasAsymmetric(obj: any, seen: Set<any> = new Set()): boolean { |
| 53 | if (seen.has(obj)) { |
| 54 | return false |
| 55 | } |
| 56 | seen.add(obj) |
| 57 | if (isAsymmetric(obj)) { |
| 58 | return true |
| 59 | } |
| 60 | if (Array.isArray(obj)) { |
| 61 | return obj.some(i => hasAsymmetric(i, seen)) |
| 62 | } |
| 63 | if (obj instanceof Set) { |
| 64 | return Array.from(obj).some(i => hasAsymmetric(i, seen)) |
| 65 | } |
| 66 | if (isObject(obj)) { |
| 67 | return Object.values(obj).some(v => hasAsymmetric(v, seen)) |
| 68 | } |
| 69 | return false |
| 70 | } |
| 71 | |
| 72 | function asymmetricMatch(a: any, b: any, customTesters: Array<Tester>) { |
| 73 | const asymmetricA = isAsymmetric(a) |
nothing calls this directly
no test coverage detected