From 31d8690c1cf880a58d0a4bd11ea344c071bcf7f2 Mon Sep 17 00:00:00 2001 From: elioat Date: Tue, 20 Aug 2024 11:21:43 -0400 Subject: * --- js/b.min.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/b.min.js b/js/b.min.js index 1a5647b..c94132e 100644 --- a/js/b.min.js +++ b/js/b.min.js @@ -1 +1,4 @@ -'use strict';const b={pipe:(...args)=>args.reduce((acc,el)=>el(acc)),compose:(...fns)=>(...args)=>fns.reduceRight((res,fn)=>[fn.call(null,...res)],args)[0],identity:x=>x,curry:(fn)=>{const curried=(...args)=>{if(args.length>=fn.length){return fn(...args)}else{return(...rest)=>curried(...args,...rest)}}return curried},match:()=>b.curry((what,s)=>s.match(what)),replace:()=>b.curry((what,replacement,s)=>s.replace(what,replacement)),filter:()=>b.curry((f,xs)=>xs.filter(f)),map:()=>b.curry((f,xs)=>xs.map(f)),deepMap:()=>b.curry(function deepMap(f,xs){return Array.isArray(xs)?xs.map((x)=>deepMap(f,x)):f(xs)})}; \ No newline at end of file +// eli_oat +// docs available in the unminified version +// https://eli.li/_assets/bin/b.js +'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)})}}; \ No newline at end of file -- cgit 1.4.1-2-gfad0