forked from enviPath/enviPy
Current Dev State
This commit is contained in:
48
static/js/ketcher2/node_modules/ap/index.js
generated
vendored
Normal file
48
static/js/ketcher2/node_modules/ap/index.js
generated
vendored
Normal file
@ -0,0 +1,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);
|
||||
}
|
||||
Reference in New Issue
Block a user