All files / construct/domain_layer/library/most MostUtils.bs.js

100% Statements 14/14
75% Branches 3/4
100% Functions 3/3
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27    7x 7x 7x   7x 1x 1x       8x 8x 6x 1x 1x     2x       7x 7x    
'use strict';
 
var Most = require("most");
var Caml_array = require("bs-platform/lib/js/caml_array.js");
var ArraySt$Wonderjs = require("../structure/ArraySt.bs.js");
 
var _isFromEventStream = (function(stream){
    var source = stream.source;
    return !!source.event && !!source.source;
  });
 
function concatArray(streamArr) {
  var match = streamArr.length;
  if (match !== 0) {
    return ArraySt$Wonderjs.reduceOneParam(ArraySt$Wonderjs.sliceFrom(streamArr, 1), (function (stream1, stream2) {
                  _isFromEventStream(stream1) === true;
                  return stream1.concat(stream2);
                }), Caml_array.caml_array_get(streamArr, 0));
  } else {
    return Most.just(1);
  }
}
 
exports._isFromEventStream = _isFromEventStream;
exports.concatArray = concatArray;
/* most Not a pure module */