update(types): remove null types and use undefined

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-22 17:14:57 +01:00
parent fec38a129a
commit b9bb3cfb1a
9 changed files with 40 additions and 25 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ export function getHandlePosition(position: Position, node: GraphNode, handle: a
}
}
export function getHandle(bounds: HandleElement[], handleId: ElementId | null): HandleElement | undefined {
export function getHandle(bounds: HandleElement[], handleId?: ElementId): HandleElement | undefined {
if (!bounds) return undefined
// there is no handleId when there are no multiple handles/ handles with ids
@@ -53,7 +53,7 @@ export function getHandle(bounds: HandleElement[], handleId: ElementId | null):
handle = bounds.find((d) => d.id === handleId)
}
return typeof handle === 'undefined' ? undefined : handle
return !handle ? undefined : handle
}
export const getEdgePositions = (