Socket
Socket
Sign inDemoInstall

@ospin/fct-graph

Package Overview
Dependencies
9
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.7 to 6.1.0

2

package.json
{
"name": "@ospin/fct-graph",
"author": "OSPIN webapp team",
"version": "6.0.7",
"version": "6.1.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",

@@ -27,6 +27,11 @@ const Joi = require('joi')

const connectsFct = (dataStream, fctId) => (
dataStream.sourceFctId === fctId || dataStream.sinkFctId === fctId
)
module.exports = {
SCHEMA,
create,
connectsFct,
connectsToFctSlot,
}

@@ -6,2 +6,3 @@ const Joi = require('joi')

const Slot = require('../slots/Slot')
const DataStream = require('../dataStreams/DataStream')
const RegexUtils = require('../utils/RegexUtils')

@@ -331,2 +332,29 @@

const removeFunctionality = (fctGraph, fctId) => {
const graphWithoutFct = update(fctGraph, {
functionalities: fctGraph.functionalities.filter(fct => fct.id !== fctId),
})
/* removing all connections to that fct */
return update(graphWithoutFct, {
functionalities: graphWithoutFct.functionalities.map(fct => ({
...fct,
slots: fct.slots.map(slot => ({
...slot,
dataStreams: slot.dataStreams.filter(ds => !DataStream.connectsFct(ds, fctId)),
})),
})),
})
}
const removeIntervalOutNode = (fctGraph, fctId, slotName) => {
const intervalOutFctId = getReporterFctIdForSlot(fctGraph, fctId, slotName)
return removeFunctionality(fctGraph, intervalOutFctId)
}
const removePushInNode = (fctGraph, fctId, slotName) => {
const pushInFctId = getInputNodeFctIdForSlot(fctGraph, fctId, slotName)
return removeFunctionality(fctGraph, pushInFctId)
}
module.exports = {

@@ -364,2 +392,5 @@ SCHEMA,

fctsDeepEquals,
removeFunctionality,
removeIntervalOutNode,
removePushInNode,
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc