( l: BaseNode, r: BaseNode, ctx: IntersectionContext )
| 153 | // but are compared wherever two meet, which can be at a key intersected |
| 154 | // before the one the inputs are disjoint at |
| 155 | const disjointInputsOf = ( |
| 156 | l: BaseNode, |
| 157 | r: BaseNode, |
| 158 | ctx: IntersectionContext |
| 159 | ): Disjoint | undefined => { |
| 160 | if (!l.isRoot() || !r.isRoot()) return |
| 161 | if (!(l.hasMorph && r.hasMorph) && !reachesDefault(l) && !reachesDefault(r)) |
| 162 | return |
| 163 | const lIn = unreadInputOf(l) |
| 164 | const rIn = lIn && unreadInputOf(r) |
| 165 | // the operands are compared as they are while an input of theirs is read |
| 166 | if (!lIn || !rIn || (lIn === l && rIn === r)) return |
| 167 | const inputs = intersectOrPipeNodes(lIn, rIn, ctx) |
| 168 | if (inputs instanceof Disjoint) return inputs |
| 169 | } |
| 170 | |
| 171 | // equal nodes can list their outputs' keys in different orders |
| 172 | export const listsKeysAlike = (l: BaseNode, r: BaseNode): boolean => |
no test coverage detected