( l: Intersection.Node, inner: Intersection.Inner, $: BaseScope )
| 90 | [...nodes].sort((l, r) => l.rule.valueOf() - r.rule.valueOf()) |
| 91 | |
| 92 | export const constrainIntersection = ( |
| 93 | l: Intersection.Node, |
| 94 | inner: Intersection.Inner, |
| 95 | $: BaseScope |
| 96 | ): BaseRoot | Disjoint => { |
| 97 | const result = intersectIntersections(l.inner, inner, { |
| 98 | $, |
| 99 | invert: false, |
| 100 | pipe: false |
| 101 | }) |
| 102 | if (result instanceof Disjoint) return result |
| 103 | return ( |
| 104 | $ark.sets!.disjointOf?.(result) ?? |
| 105 | (( |
| 106 | l.equals(result) && listsKeysAlike(l, result) && sameBoundUnits(l, result) |
| 107 | ) ? |
| 108 | l |
| 109 | : result) |
| 110 | ) |
| 111 | } |
| 112 | |
| 113 | const intersectIntersections = ( |
| 114 | l: Intersection.Inner, |
nothing calls this directly
no test coverage detected