Closed laosb closed 3 years ago
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!
For example, in the README
fromGemtext
is marked to returnRoot
while the code says it'sNode
. Though casting it toRoot
works, is there any reason for doing so?