about summary refs log tree commit diff stats
path: root/js/b/b.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/b/b.js')
-rw-r--r--js/b/b.js38
1 files changed, 1 insertions, 37 deletions
diff --git a/js/b/b.js b/js/b/b.js
index 5462e93..ee33eef 100644
--- a/js/b/b.js
+++ b/js/b/b.js
@@ -119,40 +119,4 @@ const b = {
   },
 };
 
-// Tests! 
-// pipe
-const addOne = (x) => x + 1;
-const double = (x) => x * 2;
-console.assert(b.pipe(addOne, double)(3) === 8, 'Test for pipe failed');
-
-// compose
-console.assert(b.compose(double, addOne)(3) === 8, 'Test for compose failed');
-
-// identity
-console.assert(b.identity(5) === 5, 'Test for identity failed');
-
-// curry
-const add = (x, y) => x + y;
-const curriedAdd = b.curry(add);
-console.assert(curriedAdd(3)(4) === 7, 'Test for curry failed');
-
-// match
-const matchDigits = b.match()(/\d+/g);
-console.assert(JSON.stringify(matchDigits('a1b2c3')) === JSON.stringify(['1', '2', '3']), 'Test for match failed');
-
-// replace
-const censor = b.replace()(/badword/g, '****');
-console.assert(censor('This is a badword in a sentence.') === 'This is a **** in a sentence.', 'Test for replace failed');
-
-// filter
-const isEven = (x) => x % 2 === 0;
-const filterEvens = b.filter()(isEven);
-console.assert(JSON.stringify(filterEvens([1, 2, 3, 4])) === JSON.stringify([2, 4]), 'Test for filter failed');
-
-// map
-const mapDoubles = b.map()(double);
-console.assert(JSON.stringify(mapDoubles([1, 2, 3])) === JSON.stringify([2, 4, 6]), 'Test for map failed');
-
-// deepMap
-const nestedArray = [1, [2, [3, 4]], [5, 6]];
-console.assert(JSON.stringify(b.deepMap()(double, nestedArray)) === JSON.stringify([2, [4, [6, 8]], [10, 12]]), 'Test for deepMap failed');
\ No newline at end of file
+export default b;
\ No newline at end of file