Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@comunica/mediator-combine-union

Package Overview
Dependencies
Maintainers
5
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@comunica/mediator-combine-union - npm Package Compare versions

Comparing version 3.2.4-alpha.47.0 to 3.3.0

14

lib/MediatorCombineUnion.d.ts

@@ -1,2 +0,2 @@

import type { Actor, IAction, IActorOutput, IActorTest, IMediatorArgs, TestResult } from '@comunica/core';
import type { Actor, IAction, IActorOutput, IActorTest, IMediatorArgs } from '@comunica/core';
import { Mediator } from '@comunica/core';

@@ -8,16 +8,16 @@ /**

*/
export declare class MediatorCombineUnion<A extends Actor<I, T, O, TS>, I extends IAction, T extends IActorTest, O extends IActorOutput, TS = undefined> extends Mediator<A, I, T, O, TS> implements IMediatorCombineUnionArgs<A, I, T, O, TS> {
readonly filterFailures: boolean | undefined;
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;
readonly combiner: (results: O[]) => O;
constructor(args: IMediatorCombineUnionArgs<A, I, T, O, TS>);
constructor(args: IMediatorCombineUnionArgs<A, I, T, O>);
mediate(action: I): Promise<O>;
protected mediateWith(): Promise<TestResult<any, TS>>;
protected mediateWith(): Promise<A>;
protected createCombiner(): (results: O[]) => O;
}
export interface IMediatorCombineUnionArgs<A extends Actor<I, T, O, TS>, I extends IAction, T extends IActorTest, O extends IActorOutput, TS = undefined> extends IMediatorArgs<A, I, T, O, TS> {
export interface IMediatorCombineUnionArgs<A extends Actor<I, T, O>, I extends IAction, T extends IActorTest, O extends IActorOutput> extends IMediatorArgs<A, I, T, O> {
/**
* If actors that throw test errors should be ignored
*/
filterFailures?: boolean;
filterErrors?: boolean;
/**

@@ -24,0 +24,0 @@ * The field name of the test result field over which must be mediated.

@@ -23,23 +23,19 @@ "use strict";

}
if (this.filterFailures) {
if (this.filterErrors) {
const _testResults = [];
for (const result of testResults) {
const reply = await result.reply;
if (reply.isPassed()) {
try {
await result.reply;
_testResults.push(result);
}
catch {
// Ignore errors
}
}
testResults = _testResults;
}
// Delegate reply errors.
const sideDatas = [];
await Promise.all(testResults.map(async ({ reply }, i) => {
const awaited = (await reply);
const value = awaited.getOrThrow();
sideDatas[i] = awaited.getSideData();
return value;
}));
// Delegate test errors.
await Promise.all(testResults.map(({ reply }) => reply));
// Run action on all actors.
const results = await Promise.all(testResults
.map((result, i) => result.actor.runObservable(action, sideDatas[i])));
const results = await Promise.all(testResults.map(result => result.actor.runObservable(action)));
// Return the combined results.

@@ -46,0 +42,0 @@ return this.combiner(results);

{
"name": "@comunica/mediator-combine-union",
"version": "3.2.4-alpha.47.0",
"version": "3.3.0",
"description": "A combine-union mediator",
"lsd:module": true,
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/comunica-association"
},
"homepage": "https://comunica.dev/",

@@ -42,5 +38,5 @@ "repository": {

"dependencies": {
"@comunica/core": "3.2.4-alpha.47.0"
"@comunica/core": "^3.3.0"
},
"gitHead": "85bd4c5cf07dfc293ebbc3a1416b70e2db8bfc48"
"gitHead": "02bde397d206f1f5a523643a6a604c89e792e2f9"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc