Function return values marked as `Node` while README says `Root`
Closed this issue · 5 comments
For example, in the README fromGemtext
is marked to return Root
while the code says it's Node
. Though casting it to Root
works, is there any reason for doing so?
I don’t have strong opinions on this. I’m fine with using Node
in the docs, that would make the align the method that does the inverse (toGemtext
) better with fromGemtext
.
To me it sounds using Root
would be more accurate, and for TS users they'll need to manually cast to Root
(like const result = fromGemtext(gemtext) as Root
), which is probably unnecessary. I'd vote for changing the code to align with the accurate doc markup.
Why do you need to cast to root?
Similar to toGemtext
, which accepts any node, where you’re using it could also handle different node types?
I now think you’re quite right that a root would make more sense. Is that something you could help with?
Solved!