js-awe
Advanced tools
Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "js-awe", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -7,2 +7,5 @@ import { arraySorter, pushUniqueKeyOrChange, sorterByPaths, pushUniqueKey } from './jsUtils.js'; | ||
// needed only for debuging | ||
//import { RE } from './ramdaExt.js'; | ||
function Chrono() { | ||
@@ -95,14 +98,2 @@ let now; | ||
// console.log(` | ||
// ------------------------------------------------------------------------------------------- | ||
// | events | ms 0 80 200 500 900 1100 | | ||
// |---------------------|---------------------------------------------------------------------| | ||
// | loadConfig | |----------------------| |--------| | | ||
// | getCards | |-----------| |---------------| | | ||
// | getAccounts | |------| | | ||
// | compeseFinalOutput | |--------------| |---------------| | | ||
// ------------------------------------------------------------------------------------------- | ||
// `) | ||
//plot(entriesEvents, minHrtime, maxHrtime) | ||
return events | ||
@@ -206,3 +197,3 @@ } | ||
//RE.RLog('1-->: '), | ||
R.sort(sorterByPaths('range')), | ||
R.sort(sorterByPaths('range.start')), | ||
reportListOfNameRanges, | ||
@@ -292,3 +283,18 @@ //RE.RLog('3-->: '), | ||
return { time, timeEnd, report } | ||
const setTime = event => data => { | ||
time(event) | ||
return data | ||
} | ||
const setTimeEnd = event => data => { | ||
timeEnd(event) | ||
return data | ||
} | ||
const logReport = data => { | ||
report() | ||
return data | ||
} | ||
return { time, timeEnd, report, setTime, setTimeEnd, logReport } | ||
} | ||
@@ -295,0 +301,0 @@ |
@@ -9,5 +9,5 @@ // ts-check | ||
// Only needed for testing | ||
// //Only needed for testing | ||
// import { after, both, chain, map, fork } from 'fluture'; | ||
// import { repeat, CustomError } from './jsUtils.js' | ||
// import { repeat } from './jsUtils.js' | ||
@@ -474,3 +474,3 @@ const RE = {} | ||
//Apply all the parameters to convert it to a unary function. | ||
pipeFunc = currentPipeFunc.bind(undefined, ...acum.slice(0, acum.length - 1)) | ||
pipeFunc = currentPipeFunc?.bind(undefined, ...acum.slice(0, acum.length - 1)) | ||
} | ||
@@ -512,3 +512,7 @@ | ||
} | ||
} else result = pipeFunc(elem) | ||
} else | ||
{ | ||
// Exceptions in pipeFunc will need to be handle by the caller in sync calls. | ||
result = pipeFunc(elem) | ||
} | ||
@@ -661,3 +665,3 @@ if (isAcumAFutureAndElemAnError(acum, result)) { | ||
//Apply all the parameters to convert it to a unary function. | ||
pipeFunc = currentPipeFunc.bind(undefined, ...acum.slice(0, acum.length - 1)) | ||
pipeFunc = currentPipeFunc?.bind(undefined, ...acum.slice(0, acum.length - 1)) | ||
} | ||
@@ -701,3 +705,7 @@ | ||
} | ||
} else result = pipeFunc(elem) | ||
} else | ||
{ | ||
// Exceptions in pipeFunc will need to be handle by the caller in sync calls. | ||
result = pipeFunc(elem) | ||
} | ||
@@ -798,2 +806,15 @@ if (isAcumAFutureAndElemAnError(acum, result)) { | ||
// // Example with throw error sync | ||
// // Exeption is raised up in sync mode vs async | ||
// // where exception is transjform in rejec(exception) | ||
// try { | ||
// RE.pipe( | ||
// (x,y) => x+y, | ||
// x => {throw new Error('aaaa')}, | ||
// x => x.filter(elem => elem > 15) | ||
// )(5, 6) | ||
// } catch(e) | ||
// { | ||
// console.log('Sync failed with: ', e) | ||
// } | ||
@@ -800,0 +821,0 @@ const pipeWhile = (funCond, ini) => (...funcs) => (...inputs) => { |
245145
60
7679