Skip to content

Commit 0501151

Browse files
committed
fix(core): correct return type of getIncomers & getOutgoers
Signed-off-by: braks <[email protected]>
1 parent fad894d commit 0501151

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/background/src/Background.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default {
6666
width: `${width > 100 ? 100 : width}%`,
6767
}"
6868
>
69-
<!-- todo: rename to `pattern -->
7069
<slot :id="patternId" name="pattern-container">
7170
<pattern
7271
:id="patternId"

packages/core/src/composables/useKeyPress.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ function createKeyPredicate(keyFilter: KeyFilter, pressedKeys: Set<string>): Key
3232
})
3333
}
3434

35+
/**
36+
* Reactive key press state
37+
*
38+
* @param keyFilter - Can be a boolean, a string or an array of strings. If it's a boolean, it will always return that value. If it's a string, it will return true if the key is pressed. If it's an array of strings, it will return true if any of the keys are pressed, or a combination is pressed (e.g. ['ctrl+a', 'ctrl+b'])
39+
* @param onChange - Callback function that will be called when the key state changes
40+
*/
3541
export default (keyFilter: MaybeRef<KeyFilter | null>, onChange?: (keyPressed: boolean) => void): Ref<boolean> => {
3642
const window = useWindow()
3743

@@ -42,7 +48,9 @@ export default (keyFilter: MaybeRef<KeyFilter | null>, onChange?: (keyPressed: b
4248
const pressedKeys = $ref<Set<string>>(new Set())
4349

4450
watch($$(isPressed), () => {
45-
if (onChange && typeof onChange === 'function') onChange(isPressed)
51+
if (onChange && typeof onChange === 'function') {
52+
onChange(isPressed)
53+
}
4654
})
4755

4856
watchEffect(() => {

packages/core/src/utils/graph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const getConnectedElements = (node: GraphNode, elements: Elements, dir: 'source'
131131
if (!isNode(node)) return []
132132
const origin = dir === 'source' ? 'target' : 'source'
133133
const ids = elements.filter((e) => isEdge(e) && e[origin] === node.id).map((e) => isEdge(e) && e[dir])
134-
return elements.filter((e) => ids.includes(e.id))
134+
return elements.filter((e) => ids.includes(e.id)) as GraphEdge[]
135135
}
136136
export const getOutgoers = (node: GraphNode, elements: Elements) => getConnectedElements(node, elements, 'target')
137137

0 commit comments

Comments
 (0)