Skip to content

a way to set getChildren to more than one condition? #49

@stoplion

Description

@stoplion

I have a tree that sometime has a args property and sometimes has a content property. Is a way to set getChildren to more than one condition?

crawl(tree, n => console.log(n.type, n.value || n.op), {
  getChildren: node => node.args ||  node.content
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions