mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Lint
This commit is contained in:
@@ -165,7 +165,10 @@ function extractBlockInputs(
|
||||
/**
|
||||
* Find incoming connections for a given block ID
|
||||
*/
|
||||
function findIncomingConnections(blockId: string, edges: any[]): Array<{
|
||||
function findIncomingConnections(
|
||||
blockId: string,
|
||||
edges: any[]
|
||||
): Array<{
|
||||
source: string
|
||||
sourceHandle?: string
|
||||
targetHandle?: string
|
||||
@@ -182,7 +185,10 @@ function findIncomingConnections(blockId: string, edges: any[]): Array<{
|
||||
/**
|
||||
* Find outgoing connections for a given block ID
|
||||
*/
|
||||
function findOutgoingConnections(blockId: string, edges: any[]): Array<{
|
||||
function findOutgoingConnections(
|
||||
blockId: string,
|
||||
edges: any[]
|
||||
): Array<{
|
||||
target: string
|
||||
sourceHandle?: string
|
||||
targetHandle?: string
|
||||
@@ -229,11 +235,11 @@ export function generateWorkflowYaml(
|
||||
// Only include connections if they exist
|
||||
if (incoming.length > 0 || outgoing.length > 0) {
|
||||
yamlBlock.connections = {}
|
||||
|
||||
|
||||
if (incoming.length > 0) {
|
||||
yamlBlock.connections.incoming = incoming
|
||||
}
|
||||
|
||||
|
||||
if (outgoing.length > 0) {
|
||||
yamlBlock.connections.outgoing = outgoing
|
||||
}
|
||||
|
||||
@@ -134,7 +134,9 @@ function validateBlockReferences(yamlWorkflow: YamlWorkflow): string[] {
|
||||
if (block.connections?.incoming) {
|
||||
block.connections.incoming.forEach((connection) => {
|
||||
if (!blockIds.has(connection.source)) {
|
||||
errors.push(`Block '${blockId}' references non-existent source block '${connection.source}'`)
|
||||
errors.push(
|
||||
`Block '${blockId}' references non-existent source block '${connection.source}'`
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -143,7 +145,9 @@ function validateBlockReferences(yamlWorkflow: YamlWorkflow): string[] {
|
||||
if (block.connections?.outgoing) {
|
||||
block.connections.outgoing.forEach((connection) => {
|
||||
if (!blockIds.has(connection.target)) {
|
||||
errors.push(`Block '${blockId}' references non-existent target block '${connection.target}'`)
|
||||
errors.push(
|
||||
`Block '${blockId}' references non-existent target block '${connection.target}'`
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user