Function
getParentCondition
(
node: IfConditionalExpression | CacheExpression,
)
Source from the content-addressed store, hash-verified
| 333 | } |
| 334 | |
| 335 | function getParentCondition( |
| 336 | node: IfConditionalExpression | CacheExpression, |
| 337 | ): IfConditionalExpression { |
| 338 | while (true) { |
| 339 | if (node.type === NodeTypes.JS_CONDITIONAL_EXPRESSION) { |
| 340 | if (node.alternate.type === NodeTypes.JS_CONDITIONAL_EXPRESSION) { |
| 341 | node = node.alternate |
| 342 | } else { |
| 343 | return node |
| 344 | } |
| 345 | } else if (node.type === NodeTypes.JS_CACHE_EXPRESSION) { |
| 346 | node = node.value as IfConditionalExpression |
| 347 | } |
| 348 | } |
| 349 | } |
Tested by
no test coverage detected