libxmljs2 icon indicating copy to clipboard operation
libxmljs2 copied to clipboard

type() typings missing cdata and I believe wiki referencing dtd is incorrect.

Open rylan opened this issue 3 years ago • 0 comments

HI,

I am investigating migration over from libxmljs to libxmljs2 when I noticed this difference between docs and typing information. From the typings https://github.com/marudor/libxmljs2/blob/main/index.d.ts#L122 type(): 'comment' | 'element' | 'text' | 'attribute' | 'pi'; however the docs say https://github.com/marudor/libxmljs2/blob/main/index.d.ts#L122 node.type() returns The type of the node, current returns one of ('comment', 'element', 'text', 'attribute', 'dtd', 'cdata' or 'pi') .

Looks like there is a test that confirms cdata should be there https://github.com/marudor/libxmljs2/blob/main/test/text_node.test.js#L28.

However looking into how dtd behaves I don't believe its a valid return type.

rylan avatar May 03 '22 19:05 rylan