about summary refs log tree commit diff stats
path: root/js/b/b.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/b/b.min.js')
-rw-r--r--js/b/b.min.js1
1 files changed, 1 insertions, 0 deletions
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;