was.js

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 25  →  ?path2? @ 23
/trunk/lib/lambda/aggregators.js
@@ -3,7 +3,6 @@
/*************************************************************************/
/* fuss/lambda_calculus/functional_programming/aggregators @ grimore.org */
/*************************************************************************/
// Vanilla ES6 JavaScript
function wasSwitch(q, d, ...c) {
if(c.length % 2 !== 0) {
throw "Pairs of predicates expected for cases";
@@ -26,6 +25,8 @@
}
});
}
 
// Vanilla ES6 JavaScript
if (!Array.prototype.switch) {
Array.prototype.switch = wasSwitch;
}
@@ -35,10 +36,7 @@
switch: wasSwitch
});
}
 
/*************************************************************************/
/* Node.JS package export. */
/*************************************************************************/
module.exports.lambda.aggregators = {
// Node.JS
module.exports = {
switch: wasSwitch
};