github
219 of 235 branches covered (93.19%)
Branch coverage included in aggregate %.
19 of 19 new or added lines in 4 files covered. (100.0%)
642 of 653 relevant lines covered (98.32%)
14.58 hits per line
| 1 |
function findItemInAdaptiveCard(card, id) { |
|
| 2 |
if (!card) {
|
|
| 3 |
return null; |
× |
| 4 |
} |
|
| 5 |
if (card.id === id) {
|
|
| 6 |
return card;
|
24✔ |
| 7 |
} |
|
| 8 |
let found = null;
|
458✔ |
| 9 |
let list = [] |
458✔ |
| 10 |
if (card.body) {
|
|
| 11 |
list = card.body; |
24✔ |
| 12 |
} |
|
| 13 |
if (card.items) {
|
|
| 14 |
list = card.items; |
168✔ |
| 15 |
} |
|
| 16 |
if (card.columns) {
|
|
| 17 |
list = card.columns; |
28✔ |
| 18 |
} |
|
| 19 |
for (const item of list) {
|
458✔ |
| 20 |
found = findItemInAdaptiveCard(item, id); |
458✔ |
| 21 |
if (found) {
|
|
| 22 |
return found;
|
24✔ |
| 23 |
} |
|
| 24 |
} |
|
| 25 |
return null; |
434✔ |
| 26 |
} |
|
| 27 |
|
|
| 28 |
exports.findItemInAdaptiveCard = findItemInAdaptiveCard; |
4✔ |