artdaq_node_server  v1_00_07
 All Classes Namespaces Files Variables Pages
_baseWhile.js
1 var baseSlice = require('./_baseSlice');
2 
14 function baseWhile(array, predicate, isDrop, fromRight) {
15  var length = array.length,
16  index = fromRight ? length : -1;
17 
18  while ((fromRight ? index-- : ++index < length) &&
19  predicate(array[index], index, array)) {}
20 
21  return isDrop
22  ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
23  : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
24 }
25 
26 module.exports = baseWhile;