index.js
function predicate (fn, string) {
  var idx = -1
  var end = string.length
  var out = []
  var buf = ''

  while (++idx < end) {
    if (fn(string[idx], idx) === true) {
      if (buf) out.push(buf)
      buf = ''
    } else {
      buf += string[idx]
    }
  }

  if (buf) out.push(buf)
  return out
}
function predicate (fn, string) {
  var idx = -1
  var end = string.length
  var out = []
  var buf = ''

  while (++idx < end) {
    if (fn(string[idx], idx) === true) {
      if (buf) out.push(buf)
      buf = ''
    } else {
      buf += string[idx]
    }
  }

  if (buf) out.push(buf)
  return out
}
function predicate ( fn , string ) { var idx = - 1 var end = string . length var out = [ ] var buf = '' while ( ++ idx < end ) { if ( fn ( string [ idx ] , idx ) === true ) { if ( buf ) out . push ( buf ) buf = '' } else { buf += string [ idx ] } } if ( buf ) out . push ( buf ) return out }
Split via predicate function.

@param {Function} fn
Predicate function.

@param {String} string
String to split.

@return {Array}
List of split string parts.
Split via predicate function .