Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding an AnyContainer type to allow narrowing #1793

Open
jathak opened this issue Nov 18, 2022 · 1 comment
Open

Consider adding an AnyContainer type to allow narrowing #1793

jathak opened this issue Nov 18, 2022 · 1 comment

Comments

@jathak
Copy link

jathak commented Nov 18, 2022

Similar to the AnyNode type, there should be an AnyContainer type that allows you to narrow it to a specific type of container.

The definition would probably look something like:

type AnyContainer = (AtRule|Rule|Root|Document)&Container<AnyNode>
@ai
Copy link
Member

ai commented Nov 18, 2022

Why Container doesn’t work for this?

AtRule, Rule, etc was inherited from Container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants