Skip to content

Turn NodeBase into an interface, add isNode()#665

Merged
eemeli merged 1 commit intomainfrom
no-nodebase
Feb 16, 2026
Merged

Turn NodeBase into an interface, add isNode()#665
eemeli merged 1 commit intomainfrom
no-nodebase

Conversation

@eemeli
Copy link
Copy Markdown
Owner

@eemeli eemeli commented Feb 14, 2026

Closes #656

Makes NodeBase a TS interface, rather than an actual class. This simplifies the construction of nodes a bit, at the cost of duplicating some code across the implementations -- but there were already small variations so this is perhaps better.

An isNode() type predicate function is re-introduced (churn? What churn?), as there's no longer a single thing to check with isinstance for all node types.

Many of the previous instanceof NodeBase are in fact removed completely, as they're no longer necessary given that all values in collections are nodes.

@eemeli eemeli added this to the v3 milestone Feb 14, 2026
@eemeli eemeli merged commit 786141f into main Feb 16, 2026
20 of 22 checks passed
@eemeli eemeli deleted the no-nodebase branch February 16, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose documented NodeBase type

1 participant