-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkatsu-curry.js
1 lines (1 loc) · 2.98 KB
/
katsu-curry.js
1
(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.katsuCurry={})})(this,function(a){'use strict';function b(){for(var a=arguments,b=arguments.length,c=Array(b),d=0;d<b;++d)c[d]=a[d];return g(c)}var c='\uD83C\uDF5B';var d=function(d,e){return function(f,a,b){return d.call(e,f,a,b)}};var e=function(a,b,c){var e,f=a.length,g=c===void 0?b:d(b,c);for(e=0;e<f;e++)if(g(a[e],e,a))return!0;return!1},f=function(a){var b=function(a){return a===c};return function c(){for(var d=arguments,f=arguments.length,g=Array(f),h=0;h<f;++h)g[h]=d[h];var i=e(g,b)?function(a){for(var c=a.length;!b(a[c]);)c--;return c}(g):g.length;return i>=a.length?a.apply(this,g):function(){for(var a=arguments,d=arguments.length,e=Array(d),f=0;f<d;++f)e[f]=a[f];return c.apply(this,g.map(function(a){return b(a)&&e[0]?e.shift():a}).concat(e))}}},g=function(b){return function(c){for(var d=b[0],e=b.slice(1),f=d(c),g=0;g<e.length;g++)f=e[g](f);return f}},h=f(function(a,b){return b&&a&&b[a]}),i=Object.assign,j=Object.keys,k=j,l=f(function(c,a){return i({},c,a)}),m=h('length'),n=b(k,m),p=function(a){return'object'==typeof a?n(a):m(a)},o=f(function(a,b,c){return c[a](b)}),q=o('filter'),r=f(function(a,b){return a.includes(b)}),s=f(function(a,b){return q(r(a),k(b))}),t=f(function(a,c){return b(s(a),p)(c)}),u=function(a,b){return t(a,b)>=Object.keys(a).length},v=f(function(a,b){return function c(d){return Object.keys(d).filter(function(b){return a.includes(b)}).length===a.length?b(d):function(a){return c(Object.assign({},d,a))}}}),w=f(function(a,b){var c=Array.from(b);return c.length?c.map(function(b,d){return a.includes(d)?c[a[d]]:b}):c}),x=f(function(a,b){var c=w(a),d=f(b);return function(){var a=c(Array.from(arguments));return d.apply(null,a)}});a.$=c,a.PLACEHOLDER=c,a.curry=f,a.curryObjectK=v,a.curryObjectN=function(a,b){return function c(d){return d&&Object.keys(d).length>=a?b(d):function(a){return c(Object.assign({},d,a))}}},a.curryObjectKN=function(a,b){var c=a.k,d=a.n;return function a(e){return u(c,e)||Object.keys(e).length>=d?b(e):function(b){return a(Object.assign({},e,b))}}},a.pipe=b,a.compose=function(){for(var a=arguments,b=arguments.length,c=Array(b),d=b-1;-1<d;--d)c[d]=a[d];return g(c)},a.curryify=function(a){if('function'!=typeof a)throw new TypeError('Expected to be given a function to test placeholders!');return function(b){if('function'!=typeof b)throw new TypeError('Expected to be given a function to curry!');return function c(){for(var d=arguments,f=arguments.length,g=Array(f),h=0;h<f;++h)g[h]=d[h];var i=e(g,a)?function(b){for(var c=b.length;!a(b[c]);)c--;return c}(g):g.length;return i>=b.length?b.apply(this,g):function(){for(var b=arguments,d=arguments.length,e=Array(d),f=0;f<d;++f)e[f]=b[f];return c.apply(this,g.map(function(b){return a(b)&&e[0]?e.shift():b}).concat(e))}}}},a.version='0.7.5',a.K=function(a){return function(){return a}},a.I=function(a){return a},a.remap=x,a.remapArray=w,Object.defineProperty(a,'__esModule',{value:!0})});