Skip to content

The type of Children is invalid. #8

Closed
@remcohaszing

Description

@remcohaszing

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions