Closed
Description
Subject of the issue
The type of Children
is defined as:
type Children = string | xast.Node | number | Children[]
However, it should match the type of xast.Element.children
, strings, numbers, and xast.Root
.
type Children = string | number | xast.Element.children[number] | xast.Root | Children[]
Invalid child types are unprocessed, yielding an invalid xast element node, as can be seen here
Your environment
- OS: N/A
- Packages: N/A
- Env: N/A
Steps to reproduce
N/A
Expected behavior
Xastscript types only allow valid children and nodes that are treated in a special way.
Actual behavior
Xastscript types allow any unist.Node
type as a child. This is unhandled and produces an invalid xast.Element
.