UNPKG

@promises/to-callback

Version:

To Callback is package from Promises library

8 lines (7 loc) 1.41 kB
/** * @module @promises/to-callback/fp * @copyright © 2017 Yisrael Eliav <yisraelx@gmail.com> (https://github.com/yisraelx) * @license MIT */ !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.PF=n.PF||{})}(this,function(n){"use strict";var o={};var t={"@@functional/placeholder":!0};function p(n){return"object"==typeof n&&!0===n["@@functional/placeholder"]}function e(a,l){void 0===l&&(l=a.length);var c=function(f,i){return function(n,t){if(void 0===t&&(t=n.length),!o[t]){for(var e=[],r=0;r<t;r++)e.push("p"+r);o[t]=new Function("fn","return function ("+e.join(", ")+"){\n return fn.apply(this, arguments);\n };")}return o[t](n)}(function(){for(var n=arguments.length<l?arguments.length:l,t=[].concat(f),e=i,r=0,o=0;o<n;o++){for(var u=arguments[o];r<l&&!p(t[r]);)r++;p(u)||(e++,t[r]=u),r++}return l<=e?a.apply(this,t):c(t,e)},l-i)},n=Array.apply(null,Array(l)).map(function(){return t});return c(n,0)}var r,u,f=(r=function(n,t){return Promise.resolve(n).then(function(n){return t(null,n)},t)},void 0===u&&(u=r.length),e(function(){var n=arguments.length,t=Array(n);if(n){t[0]=arguments[--n];for(var e=0;e<n;e++)t[e+1]=arguments[e]}return r.apply(this,t)},u));n.default=f,n.__=t,Object.defineProperty(n,"__esModule",{value:!0}),n.toCallback=n.default}); //# sourceMappingURL=bundle.umd.min.js.map