@comunica/mediator-combine-union
Advanced tools
Comparing version 3.0.1-alpha.43.0 to 3.0.1-alpha.44.0
@@ -9,2 +9,3 @@ import type { Actor, IAction, IActorOutput, IActorTest, IMediatorArgs } from '@comunica/core'; | ||
export declare class MediatorCombineUnion<A extends Actor<I, T, O>, I extends IAction, T extends IActorTest, O extends IActorOutput> extends Mediator<A, I, T, O> implements IMediatorCombineUnionArgs<A, I, T, O> { | ||
readonly filterErrors: boolean | undefined; | ||
readonly field: string; | ||
@@ -19,2 +20,6 @@ readonly combiner: (results: O[]) => O; | ||
/** | ||
* If actors that throw test errors should be ignored | ||
*/ | ||
filterErrors?: boolean; | ||
/** | ||
* The field name of the test result field over which must be mediated. | ||
@@ -21,0 +26,0 @@ */ |
@@ -23,2 +23,15 @@ "use strict"; | ||
} | ||
if (this.filterErrors) { | ||
const _testResults = []; | ||
for (const result of testResults) { | ||
try { | ||
await result.reply; | ||
_testResults.push(result); | ||
} | ||
catch { | ||
// Ignore errors | ||
} | ||
} | ||
testResults = _testResults; | ||
} | ||
// Delegate test errors. | ||
@@ -25,0 +38,0 @@ await Promise.all(testResults.map(({ reply }) => reply)); |
{ | ||
"name": "@comunica/mediator-combine-union", | ||
"version": "3.0.1-alpha.43.0", | ||
"version": "3.0.1-alpha.44.0", | ||
"description": "A combine-union mediator", | ||
@@ -33,3 +33,3 @@ "lsd:module": true, | ||
"dependencies": { | ||
"@comunica/core": "3.0.1-alpha.43.0" | ||
"@comunica/core": "3.0.1-alpha.44.0" | ||
}, | ||
@@ -41,3 +41,3 @@ "scripts": { | ||
}, | ||
"gitHead": "d11e44cf07d4699f9d2c51d5851b5ed443de1997" | ||
"gitHead": "0b13082c2eef06a45298b30620323d0f956e1a3e" | ||
} |
@@ -46,2 +46,3 @@ # Comunica Mediator Combine Union | ||
* `field`: The field name to mediate over. | ||
* `filterErrors`: Optional flag to indicate if actors that throw test errors should be filtered out of the pipeline, defaults to false. | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26471
103
48
+ Added@comunica/core@3.0.1-alpha.44.0(transitive)
+ Added@comunica/types@3.0.1-alpha.44.0(transitive)
- Removed@comunica/core@3.0.1-alpha.43.0(transitive)
- Removed@comunica/types@3.0.1-alpha.43.0(transitive)