You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
4th overload (name, ...children) is not working as expected #16
The runtime code matches (name: string, attributes?: Attributes, ...children: Array<Child>): Element but the TS type matches x(name: string, ...children: Array<Child>): Element:
Activity
JounQin commentedon Oct 10, 2026
It's matched as
attributeswhich is expected.See also
xastscript/lib/index.js
Lines 150 to 161 in c1b6eca
So you can try array instead.
github-actions commentedon Oct 10, 2026
GauBen commentedon Oct 10, 2026
@JounQin then the TS type needs to be updated if this is not supported
From
(name: string, ...children: Array<Child>): Elementto(name: string, children: Array<Child>): Elementmaybe?JounQin commentedon Oct 10, 2026
@GauBen No, it's just
(name: string, attributes?: Attributes, ...children: Array<Child>): Elementbeen matched.x("bar", "baz")matchesAttributes, it's hard to distinguish a singleChildvsAttributesat runtime.GauBen commentedon Oct 10, 2026
The runtime code matches
(name: string, attributes?: Attributes, ...children: Array<Child>): Elementbut the TS type matchesx(name: string, ...children: Array<Child>): Element:ts playground