Code coverage report for nodash/lib/function.js

Statements: 100% (17 / 17)      Branches: 100% (0 / 0)      Functions: 100% (15 / 15)      Lines: 100% (17 / 17)      Ignored: none     

All files » nodash/lib/ » function.js
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62      1   5   5         1116 1137         6       3       1       17       24       28 62         7       1 3         1 3            
/* vim: set et sw=2 ts=2: */
'use strict';
 
module.exports = [ 'curried', 'id', function (curried, id) {
 
  var Nodash = this;
 
  return {
 
    id: id,
 
    idf: function (x) {
      return function () {
        return x;
      };
    },
 
    'const const_ constant': function (a, b) {
      return a;
    },
 
    '$ apply': function (f, x) {
      return f(x);
    },
 
    invoke: function (f) {
      return f();
    },
 
    '. compose': function (f, g, x) {
      return f(g(x));
    },
 
    compose2: function (f, g, x, y) {
      return f(g(x, y));
    },
 
    flip: function (f) {
      return curried(function (b, a) {
        return f(a, b);
      });
    },
 
    on: function (g, f, a, b) {
      return g(f(a), f(b));
    },
 
    curry: function (f) {
      return curried(function (a, b) {
        return f(Nodash.tuple(a, b));
      });
    },
 
    uncurry: function (f) {
      return function (t) {
        return f(Nodash.fst(t), Nodash.snd(t));
      };
    }
    
  };
}];