@ospin/fct-graph
Advanced tools
Comparing version 2.9.1 to 2.10.0
{ | ||
"name": "@ospin/fct-graph", | ||
"author": "danielseehausen", | ||
"version": "2.9.1", | ||
"version": "2.10.0", | ||
"description": "Graph data structure with conditional edges via 'slots' on nodes. Intended to represent physical and virtual functionalities on a device.", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -160,4 +160,10 @@ const Joi = require('joi') | ||
getConnectedFctsByName(targetName) { | ||
return this.connectedFcts.filter(({ name }) => ( | ||
targetName === name | ||
)) | ||
} | ||
} | ||
module.exports = Functionality |
@@ -54,4 +54,14 @@ const Joi = require('joi') | ||
get source() { | ||
const { sources, name } = this | ||
if (sources.length > 1) { | ||
throw new Error(`Output Node: ${name} has more than one connected fct. Output nodes may only have one source. Current sources: ${sources}`) | ||
} | ||
return sources[0] | ||
} | ||
} | ||
module.exports = OutputNode |
@@ -25,5 +25,8 @@ const OutputNodeSeeder = require('./OutputNodeSeeder') | ||
static generateFloatPushOutCelsius() { | ||
static generateFloatPushOutCelsius(overrideData) { | ||
return this.generate({ | ||
slots: [ FloatInSlotSeeder.generate({ unit: '°C' }) ], | ||
slots: [ | ||
FloatInSlotSeeder.generate({ name: 'value in', unit: '°C' }), | ||
], | ||
...overrideData, | ||
}) | ||
@@ -30,0 +33,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125110
2556