4 * Isolate a burst, given a model and a list of models
6 function findBurstModels(_
, collection
, model
) {
7 var startIndex
= _
.indexOf(collection
, model
);
8 var endIndex
= startIndex
+ 1;
12 if (startIndex
< 0) return result
;
14 if (!_
.get(model
, 'burstStart')) {
17 i
= _
.at(collection
, startIndex
);
18 while (startIndex
>= 0) {
20 if (_
.get(i
, 'burstStart')) break; // Quit the loop
23 if (startIndex
>= 0) {
24 i
= _
.at(collection
, startIndex
);
30 endIndex
< collection
.length
&&
31 (i
= _
.at(collection
, endIndex
)) &&
32 !_
.get(i
, 'burstStart')
41 module
.exports
= findBurstModels
;