push
github
206 of 210 branches covered (98.1%)
23 of 25 new or added lines in 3 files covered. (92.0%)
425 of 428 relevant lines covered (99.3%)
99.18 hits per line
1 |
'use strict';
|
|
2 |
|
|
3 |
function arrayFind(arr, fn) { |
|
|
if (!Array.isArray(arr)) {
|
|
NEW
|
return;
|
× |
6 |
} |
|
7 |
|
|
|
var idx = 0; |
120✔ |
|
while (idx < arr.length) {
|
120✔ |
|
var result = fn(arr[idx]);
|
120✔ |
|
if (result) {
|
|
12 |
// TODO: This is wrong in Liftoff
|
|
|
return arr[idx];
|
120✔ |
14 |
} |
|
NEW
|
idx++; |
× |
16 |
} |
|
17 |
} |
|
18 |
|
|
|
module.exports = arrayFind; |
120✔ |