was.js

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 39  →  ?path2? @ 40
/trunk/dist/was.js
@@ -1,4 +1,4 @@
/*! was.js - v1.0.1 - 2019-08-01
/*! was.js - v1.0.3 - 2019-08-01
* http://grimore.org
* Copyright (c) 2019 [object Object]; Licensed GPL-3.0 */
/* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */
@@ -218,13 +218,12 @@
/*************************************************************************/
/* fuss/lambda_calculus/functional_programming/aggregators @ grimore.org */
/*************************************************************************/
// Vanilla ES6 JavaScript
function wasSwitch() {
if(arguments.length - 2 % 2 !== 0) {
if(arguments.length % 2 !== 0) {
throw "Pairs of predicates expected for cases";
}
(Array.isArray(arguments[0]) ? arguments[0] : [ arguments[0] ]).forEach((s) => {
(Array.isArray(arguments[0]) ? arguments[0] : [ arguments[0] ]).forEach(function(s) {
var m = false;
for(var i = 2; i < arguments.length; i += 2) {
if(!arguments[i](s)) {