update(types): Connection target and source as non-nullable strings

* Required for a valid edge, so it should be required in a connection as well
This commit is contained in:
Braks
2022-04-11 11:30:10 +02:00
parent eb81b9d157
commit 8fbb1cf505
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ export const checkElementBelowIsValid = (
const result: Result = {
elementBelow,
isValid: false,
connection: { source: null, target: null, sourceHandle: null, targetHandle: null },
connection: { source: '', target: '', sourceHandle: null, targetHandle: null },
isHoveringHandle: false,
}
@@ -55,7 +55,7 @@ export const checkElementBelowIsValid = (
}
result.connection = connection
result.isValid = isValidConnection(connection)
result.isValid = isValidConnection(connection) || !result.connection.target || !result.connection.source
}
}
+2 -2
View File
@@ -14,9 +14,9 @@ export enum ConnectionLineType {
/** Connection params that are passed when onConnect is called */
export interface Connection {
/** Source node id */
source: string | null
source: string
/** Target node id */
target: string | null
target: string
/** Source handle id */
sourceHandle: string | null
/** Target handle id */