New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@comunica/mediator-number

Package Overview
Dependencies
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@comunica/mediator-number - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

lib/MediatorNumber.d.ts

@@ -14,2 +14,3 @@ import { Actor, IAction, IActorOutput, IActorReply, IActorTest, IMediatorArgs, Mediator } from "@comunica/core";

readonly type: string;
readonly ignoreErrors: boolean;
readonly indexPicker: (tests: T[]) => number;

@@ -36,2 +37,6 @@ constructor(args: IMediatorNumberArgs<A, I, T, O>);

type: string;
/**
* If actors that throw test errors should be ignored
*/
ignoreErrors?: boolean;
}

8

lib/MediatorNumber.js

@@ -40,3 +40,9 @@ "use strict";

async mediateWith(action, testResults) {
const results = await Promise.all(require('lodash.map')(testResults, 'reply'));
let promises = require('lodash.map')(testResults, 'reply');
if (this.ignoreErrors) {
const dummy = {};
dummy[this.field] = null;
promises = promises.map((p) => p.catch(() => dummy));
}
const results = await Promise.all(promises);
return testResults[this.indexPicker(results)].actor;

@@ -43,0 +49,0 @@ }

4

package.json
{
"name": "@comunica/mediator-number",
"version": "1.0.0",
"version": "1.1.0",
"description": "A mediator for a single mediation number value",

@@ -39,3 +39,3 @@ "lsd:module": "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number",

"devDependencies": {
"@comunica/core": "^1.0.0"
"@comunica/core": "^1.1.0"
},

@@ -42,0 +42,0 @@ "jest": {

# Comunica Number Mediator
[![npm version](https://badge.fury.io/js/%40comunica%2Fmediator-number.svg)](https://www.npmjs.com/package/@comunica/mediator-number)
A mediator that can mediate over a single number field.

@@ -4,0 +6,0 @@ It can either choose the actor with the maximum or with the minimum value.

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