Skip to content

Commit ccaf07e

Browse files
committed
generic-utils: increased type safety
1 parent 84f159f commit ccaf07e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WABinary/generic-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export const getBinaryNodeChildren = (node: BinaryNode | undefined, childTag: st
2525
}
2626

2727
// Return first matching child
28-
return index.get(childTag)
28+
return index.get(childTag) || []
2929
}
3030

3131
export const getBinaryNodeChild = (node: BinaryNode | undefined, childTag: string) => {
32-
return getBinaryNodeChildren(node, childTag)?.[0]
32+
return getBinaryNodeChildren(node, childTag)[0]
3333
}
3434

3535
export const getAllBinaryNodeChildren = ({ content }: BinaryNode) => {

0 commit comments

Comments
 (0)