File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
packages/visitors-core/src Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @kinobi-so/visitors-core " : patch
3+ ---
4+
5+ Add missing getOrThrow implementation
Original file line number Diff line number Diff line change @@ -49,11 +49,17 @@ export class LinkableDictionary {
4949 getOrThrow ( linkNode : AccountLinkNode ) : AccountNode ;
5050 getOrThrow ( linkNode : DefinedTypeLinkNode ) : DefinedTypeNode ;
5151 getOrThrow ( linkNode : LinkNode ) : LinkableNode {
52- throw new KinobiError ( KINOBI_ERROR__LINKED_NODE_NOT_FOUND , {
53- kind : linkNode . kind ,
54- linkNode,
55- name : linkNode . name ,
56- } ) ;
52+ const node = this . get ( linkNode as ProgramLinkNode ) as LinkableNode ;
53+
54+ if ( ! node ) {
55+ throw new KinobiError ( KINOBI_ERROR__LINKED_NODE_NOT_FOUND , {
56+ kind : linkNode . kind ,
57+ linkNode,
58+ name : linkNode . name ,
59+ } ) ;
60+ }
61+
62+ return node ;
5763 }
5864
5965 get ( linkNode : ProgramLinkNode ) : ProgramNode | undefined ;
You can’t perform that action at this time.
0 commit comments