was.js – Diff between revs 40 and 41
?pathlinks?
Rev 40 | Rev 41 | |||
---|---|---|---|---|
1 | /*! was.js - v1.0.3 - 2019-08-01 |
1 | /*! was.js - v1.0.4 - 2019-08-03 |
|
2 | * http://grimore.org |
2 | * http://grimore.org |
|
3 | * Copyright (c) 2019 [object Object]; Licensed GPL-3.0 */ |
3 | * Copyright (c) 2019 [object Object]; Licensed GPL-3.0 */ |
|
4 | |
- | ||
5 | function wasProduct(e,t){for(var r=Math.max(e.length,t.length),n={},a=0;a<r;++a)n[e[a]]=t[a];return n}function wasStride(e,t){return e.filter(function(e,r){return r%t==0})}function wasChunk(e,t){return e.length?[e.slice(0,t)].concat(e.slice(t).wasChunk(t)):[]}function wasEquals(e,t){if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0,n=e.length;r<n;r++)if(e[r]instanceof Array&&t[r]instanceof Array){if(!e[r].equals(t[r]))return!1}else if(e[r]!==t[r])return!1;return!0}function wasCSVToArray(e){var t=[],r=[],n="";do{var a=e.charAt(0);if(e=e.slice(1,e.length),","!==a)if('"'!==a||e.charAt(0)!==a)if('"'!==a)n+=a;else{if(r[r.length-1]!==a){r.push(a);continue}r.pop()}else n+=a,e=e.slice(1,e.length);else{if('"'!==r[r.length-1]){t.push(n),n="";continue}n+=a}}while(""!==e);return t.push(n),t}function wasArrayToCSV(e){for(var t=[],r=0;r<e.length;++r){var n=e[r].toString().replace('"','""');/"\s,\r\n/.test(n)?t[r]='"'+n+'"':t[r]=n}return t.join()}function wasKeyValueToObject(e){var t={};return e.reduce(function(e,t,r){return e[r=Math.floor(r/2)]||(e[r]=[]),e[r].push(t),e},[]).forEach(function(e,r,n){t[e[0]]=e[1]},t),t}function wasSwitch(){if(arguments.length%2!=0)throw"Pairs of predicates expected for cases";(Array.isArray(arguments[0])?arguments[0]:[arguments[0]]).forEach(function(e){for(var t=!1,r=2;r |
4 | |
|
- | 5 | function wasProduct(e,t){for(var r=Math.max(e.length,t.length),o={},n=0;n<r;++n)o[e[n]]=t[n];return o}function wasStride(e,t){return e.filter(function(e,r){return r%t==0})}function wasChunk(e,t){return e.length?[e.slice(0,t)].concat(e.slice(t).wasChunk(t)):[]}function wasEquals(e,t){if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;r++)if(e[r]instanceof Array&&t[r]instanceof Array){if(!e[r].equals(t[r]))return!1}else if(e[r]!==t[r])return!1;return!0}function wasCSVToArray(e){var t=[],r=[],o="";do{var n=e.charAt(0);if(e=e.slice(1,e.length),","!==n)if('"'!==n||e.charAt(0)!==n)if('"'!==n)o+=n;else{if(r[r.length-1]!==n){r.push(n);continue}r.pop()}else o+=n,e=e.slice(1,e.length);else{if('"'!==r[r.length-1]){t.push(o),o="";continue}o+=n}}while(""!==e);return t.push(o),t}function wasArrayToCSV(e){for(var t=[],r=0;r<e.length;++r){var o=e[r].toString().replace('"','""');/"\s,\r\n/.test(o)?t[r]='"'+o+'"':t[r]=o}return t.join()}function wasKeyValueToObject(e){var t={};return e.reduce(function(e,t,r){return e[r=Math.floor(r/2)]||(e[r]=[]),e[r].push(t),e},[]).forEach(function(e,r,o){t[e[0]]=e[1]},t),t}function wasSwitch(){if(arguments.length%2!=0)throw"Pairs of predicates expected for cases";(Array.isArray(arguments[0])?arguments[0]:[arguments[0]]).forEach(function(e){for(var t=!1,r=2;r |
||
6 | |
6 | |
|
7 | |
7 | |
|
8 | |
8 | |
|
9 | |
9 | |
|
10 | |
10 | |