/usr/lib/nodejs/ap/index.js is in node-ap 0.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | exports = module.exports = ap;
function ap (args, fn) {
return function () {
var rest = [].slice.call(arguments)
, first = args.slice()
first.push.apply(first, rest)
return fn.apply(this, first);
};
}
exports.pa = pa;
function pa (args, fn) {
return function () {
var rest = [].slice.call(arguments)
rest.push.apply(rest, args)
return fn.apply(this, rest);
};
}
exports.apa = apa;
function apa (left, right, fn) {
return function () {
return fn.apply(this,
left.concat.apply(left, arguments).concat(right)
);
};
}
exports.partial = partial;
function partial (fn) {
var args = [].slice.call(arguments, 1);
return ap(args, fn);
}
exports.partialRight = partialRight;
function partialRight (fn) {
var args = [].slice.call(arguments, 1);
return pa(args, fn);
}
exports.curry = curry;
function curry (fn) {
return partial(partial, fn);
}
exports.curryRight = function curryRight (fn) {
return partial(partialRight, fn);
}
|