Code coverage report for lib/route.js

Statements: 100% (13 / 13)      Branches: 100% (12 / 12)      Functions: 100% (6 / 6)      Lines: 100% (13 / 13)      Ignored: 4 branches     

All files » lib/ » route.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1 1 1 10 37       1 1   6 15 15 15         1      
(function(){
  var σ;
  σ = require('highland');
  exports.route = curry$(function(fns, req){
    return fns.reduce(function(acc, fn){
      return acc.otherwise(fn(req));
    }, σ([]));
  });
  /* istanbul ignore next */
  function curry$(f, bound){
    var context,
    _curry = function(args) {
      return f.length > 1 ? function(){
        var params = args ? args.concat() : [];
        context = bound ? context || this : this;
        return params.push.apply(params, arguments) <
            f.length && arguments.length ?
          _curry.call(context, params) : f.apply(context, params);
      } : f;
    };
    return _curry();
  }
}).call(this);