Skip to content

plugin transformer does not support async functions #35

Closed
@Pyrolistical

Description

@Pyrolistical
  • node 8+

Steps to reproduce

function plugin() {
  return async function transformer(tree) {
    tree.children = await somethingAsync()
    return tree
  }
}

Expected behaviour

Expect to be the same as

function plugin() {
  return function transformer(tree) {
    return somethingAsync()
      .then((result) => {
        tree.children = result
        return tree
      })
  }
}

Actual behaviour

The plugin is skipped.

Root cause

serapath/x-is-function#1

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