github
138 of 142 branches covered (97.18%)
Branch coverage included in aggregate %.
57 of 61 new or added lines in 3 files covered. (93.44%)
247 of 251 relevant lines covered (98.41%)
326.87 hits per line
1 |
'use strict';
|
|
2 |
|
|
3 |
function arrayFind(arr, fn) { |
|
|
if (!Array.isArray(arr)) {
|
|
NEW
|
return;
|
× |
6 |
} |
|
7 |
|
|
|
var idx = 0; |
168✔ |
|
while (idx < arr.length) {
|
168✔ |
|
var result = fn(arr[idx]);
|
180✔ |
|
if (result) {
|
|
|
return result;
|
144✔ |
13 |
} |
|
|
idx++; |
36✔ |
15 |
} |
|
16 |
} |
|
17 |
|
|
|
module.exports = arrayFind; |
288✔ |