From 8b0f342808ce24c11994a9551c0326b9c775c93c Mon Sep 17 00:00:00 2001 From: elioat Date: Tue, 20 Aug 2024 11:37:14 -0400 Subject: * --- js/b/b.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 js/b/b.min.js (limited to 'js') diff --git a/js/b/b.min.js b/js/b/b.min.js new file mode 100644 index 0000000..0f7aba0 --- /dev/null +++ b/js/b/b.min.js @@ -0,0 +1 @@ +"use strict";const b={curry:function(fn){const curried=(...args)=>{if(args.length>=fn.length)return fn(...args);else return(...rest)=>curried(...args,...rest)};return curried},pipe:(...fns)=>value=>fns.reduce((acc,fn)=>fn(acc),value),compose:(...fns)=>(...args)=>fns.reduceRight((res,fn)=>fn(...[].concat(res)),args),identity:x=>x,match:function(){return this.curry((what,s)=>s.match(what))},replace:function(){return this.curry((what,replacement,s)=>s.replace(what,replacement))},filter:function(){return this.curry((f,xs)=>xs.filter(f))},map:function(){return this.curry((f,xs)=>xs.map(f))},deepMap:function(){return this.curry(function deepMap(f,xs){return Array.isArray(xs)?xs.map(x=>deepMap(f,x)):f(xs)})}};export default b; -- cgit 1.4.1-2-gfad0