(sources, index, propagate)
| 8 | */ |
| 9 | |
| 10 | export function _resolveTarget(sources, index, propagate) { |
| 11 | const source = sources[index]; |
| 12 | let fill = source.fill; |
| 13 | const visited = [index]; |
| 14 | let target; |
| 15 | |
| 16 | if (!propagate) { |
| 17 | return fill; |
| 18 | } |
| 19 | |
| 20 | while (fill !== false && visited.indexOf(fill) === -1) { |
| 21 | if (!isFinite(fill)) { |
| 22 | return fill; |
| 23 | } |
| 24 | |
| 25 | target = sources[fill]; |
| 26 | if (!target) { |
| 27 | return false; |
| 28 | } |
| 29 | |
| 30 | if (target.visible) { |
| 31 | return fill; |
| 32 | } |
| 33 | |
| 34 | visited.push(fill); |
| 35 | fill = target.fill; |
| 36 | } |
| 37 | |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * @param {LineElement} line |
no outgoing calls
no test coverage detected