( before: BaseRoot, after?: BaseRoot, inIntersection = false )
| 128 | // `after` no longer preserves (e.g. `.partial()` / `.required()` preserve |
| 129 | // unchanged branches at runtime) |
| 130 | const dropsUserPredicate = ( |
| 131 | before: BaseRoot, |
| 132 | after?: BaseRoot, |
| 133 | inIntersection = false |
| 134 | ): boolean => { |
| 135 | for (const branch of before.branches) { |
| 136 | if (!branch.is("intersection") || !branch.inner.predicate) continue |
| 137 | const userPredicates = branch.inner.predicate.filter(isUserPredicate) |
| 138 | if (!userPredicates.length) continue |
| 139 | if ( |
| 140 | !after?.branches.some( |
| 141 | afterBranch => |
| 142 | afterBranch === branch || |
| 143 | afterBranch.equals(branch) || |
| 144 | (inIntersection && |
| 145 | hasUserPredicatesOf(afterBranch, userPredicates) && |
| 146 | afterBranch.extends(branch)) |
| 147 | ) |
| 148 | ) |
| 149 | return true |
| 150 | } |
| 151 | return false |
| 152 | } |
| 153 | |
| 154 | const structuralRootMethods = new Map<Function, DroppedNarrowOp>([ |
| 155 | [BaseRoot.prototype.merge, ".merge()"], |
no test coverage detected