@ospin/fct-graph
Advanced tools
Comparing version 6.0.6 to 6.0.7
{ | ||
"name": "@ospin/fct-graph", | ||
"author": "OSPIN webapp team", | ||
"version": "6.0.6", | ||
"version": "6.0.7", | ||
"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", |
@@ -5,4 +5,4 @@ const Joi = require('joi') | ||
const RegexUtils = require('../utils/RegexUtils') | ||
const Slot = require('../slots/Slot') | ||
const ObjUtils = require('../utils/ObjUtils') | ||
const Slot = require('../slots/Slot') | ||
@@ -22,2 +22,4 @@ const FIXED_TYPES = { | ||
purpose: Joi.string().required(), | ||
// some devices share a port, so they have to be internally distinguished within the port | ||
unitId: Joi.string(), | ||
}) | ||
@@ -94,2 +96,9 @@ | ||
const getPortId = fct => { | ||
const [ port ] = fct.ports | ||
const { name, unitId } = port | ||
if (unitId) return `${name}-${unitId}` | ||
return name | ||
} | ||
const getAllDataStreams = fct => ( | ||
@@ -199,2 +208,3 @@ Array.from( | ||
getConnectedSinkFctIds, | ||
getPortId, | ||
isConnectedToFct, | ||
@@ -201,0 +211,0 @@ connectsToFctSlot, |
72062
1066