was.js – Diff between revs 40 and 41

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 40 Rev 41
Line 1... Line 1...
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 /* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */ 4 /* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */
5 /*************************************************************************/ 5 /*************************************************************************/
6 function wasProduct(a, b) { 6 function wasProduct(a, b) {
Line 111... Line 111...
111 } 111 }
Line 112... Line 112...
112   112  
113 /*************************************************************************/ 113 /*************************************************************************/
114 /* Node.JS package export. */ 114 /* Node.JS package export. */
115 /*************************************************************************/ 115 /*************************************************************************/
116 if(typeof variable !== 'undefined') { 116 if(typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
117 module.exports.collections = { 117 module.exports.collections = {
118 product: wasProduct, 118 product: wasProduct,
119 stride: wasStride, 119 stride: wasStride,
120 chunk: wasChunk, 120 chunk: wasChunk,
Line 176... Line 176...
176 csv[i] = cell; 176 csv[i] = cell;
177 } 177 }
178 return csv.join(); 178 return csv.join();
179 } 179 }
Line 180... Line -...
180   -  
181 /*************************************************************************/ 180  
182 /* Node.JS package export. */ 181 /* Node.JS package export. */
183 /*************************************************************************/ 182 /*************************************************************************/
-   183 if(typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
184 if(typeof variable !== 'undefined') { 184 /* global wasCSVToArray, wasArrayToCSV, wasKeyValueToObject */
-   185 module.exports.formats = {
185 module.exports.formats = { 186 csv: {
186 CSVToArray: wasCSVToArray, 187 CSVToArray: wasCSVToArray,
-   188 ArrayToCSV: wasArrayToCSV
-   189 },
-   190 kvp: {
-   191 KeyValueToObject: wasKeyValueToObject
187 ArrayToCSV: wasArrayToCSV 192 }
188 }; 193 };
Line 189... Line 194...
189 } 194 }
190   195  
Line 203... Line 208...
203 o[c[0]] = c[1]; 208 o[c[0]] = c[1];
204 }, o); 209 }, o);
205 return o; 210 return o;
206 } 211 }
Line 207... Line -...
207   -  
208 /*************************************************************************/ -  
209 /* Node.JS package export. */ -  
210 /*************************************************************************/ -  
211 if(typeof variable !== 'undefined') { -  
212 module.exports.formats = { -  
213 KeyValueToObject: wasKeyValueToObject -  
214 }; -  
215 } -  
216   212  
217 /* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */ 213 /* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */
218 /*************************************************************************/ 214 /*************************************************************************/
219 /* fuss/lambda_calculus/functional_programming/aggregators @ grimore.org */ 215 /* fuss/lambda_calculus/functional_programming/aggregators @ grimore.org */
220 /*************************************************************************/ 216 /*************************************************************************/
Line 253... Line 249...
253 } 249 }
Line 254... Line 250...
254   250  
255 /*************************************************************************/ 251 /*************************************************************************/
256 /* Node.JS package export. */ 252 /* Node.JS package export. */
257 /*************************************************************************/ 253 /*************************************************************************/
258 if(typeof variable !== 'undefined') { 254 if(typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
259 module.exports.lambda = { 255 module.exports.lambda = {
260 switch: wasSwitch 256 switch: wasSwitch
261 }; 257 };
Line 270... Line 266...
270 } 266 }
Line 271... Line 267...
271   267  
272 /*************************************************************************/ 268 /*************************************************************************/
273 /* Node.JS package export. */ 269 /* Node.JS package export. */
274 /*************************************************************************/ 270 /*************************************************************************/
275 if(typeof variable !== 'undefined') { 271 if(typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
276 module.exports.mathematics = { 272 module.exports.mathematics = {
277 MapValueToRange: wasMapValueToRange 273 MapValueToRange: wasMapValueToRange
278 }; 274 };
Line 310... Line 306...
310   306  
Line 311... Line 307...
311   307  
312   308  
313   309  
314   310  
315   311  
316   312  
317   313  
318   314  
319   315