was.js

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 16  →  ?path2? @ 17
/trunk/Gruntfile.js
@@ -45,7 +45,9 @@
eqnull: true,
globals: {
'$': false
}
},
// spread/rest operator
esnext: true
},
gruntfile: {
src: 'Gruntfile.js'
/trunk/lib/lambda/aggregators.js
@@ -5,21 +5,25 @@
/*************************************************************************/
if (!Array.prototype.switch) {
Array.prototype.switch = function(d, ...c) {
if(c.length % 2 != 0)
if(c.length % 2 !== 0) {
throw "Pairs of predicates expected for cases";
}
(Array.isArray(this) ? this : [ this ]).forEach((s) => {
var m = false;
for(i = 0; i < c.length; i += 2) {
if(!c[i](s))
for(var i = 0; i < c.length; i += 2) {
if(!c[i](s)) {
continue;
if(!c[i + 1](s))
}
if(!c[i + 1](s)) {
continue;
}
m = true;
}
if(!m)
d(s)
if(!m) {
d(s);
}
});
};
}
@@ -31,21 +35,25 @@
/*************************************************************************/
$.extend({
switch: function(q, d, ...c) {
if(c.length % 2 != 0)
if(c.length % 2 !== 0) {
throw "Pairs of predicates expected for cases";
}
(Array.isArray(q) ? q : [ q ]).forEach((s) => {
var m = false;
for(i = 0; i < c.length; i += 2) {
if(!c[i](s))
for(var i = 0; i < c.length; i += 2) {
if(!c[i](s)) {
continue;
if(!c[i + 1](s))
}
if(!c[i + 1](s)) {
continue;
}
m = true;
}
if(!m)
d(s)
if(!m) {
d(s);
}
});
}
});
/trunk/package.json
@@ -7,8 +7,7 @@
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-uglify": "~0.5.0"
"grunt-contrib-concat": "~0.4.0"
},
"name": "was.js",
"description": "Original repo at http://svn.grimore.org/was.js",