auto-curry
Version:
Supercharge your functions by giving them the ability to auto-curry
1 lines • 1.09 kB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.autoCurry=e()}}(function(){return function e(n,r,t){function o(f,u){if(!r[f]){if(!n[f]){var c="function"==typeof require&&require;if(!u&&c)return c(f,!0);if(i)return i(f,!0);var l=new Error("Cannot find module '"+f+"'");throw l.code="MODULE_NOT_FOUND",l}var a=r[f]={exports:{}};n[f][0].call(a.exports,function(e){var r=n[f][1][e];return o(r?r:e)},a,a.exports,e,n,r,t)}return r[f].exports}for(var i="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}({1:[function(e,n,r){n.exports=function e(n){"use strict";var r=[].slice.call(arguments),t=typeof n;if("function"!==t)throw new Error("auto-curry: Invalid parameter. Expected function, received "+t);return n.length<=1?n:r.length-1>=n.length?n.apply(this,r.slice(1)):function(){return e.apply(this,r.concat([].slice.call(arguments)))}}},{}]},{},[1])(1)});