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

fix: Preprocessors may return promises, but not resolve to 'content'. #3383

Closed

Commits on Oct 17, 2019

  1. fix: Preprocessors may return promises, but not content.

    The original API for Preprocessors assumed callback.
    Now promises are a valid return.
    If an implementer returns a promise from `process`
    but only resolves content via the callback,
    then while the result of `process` is a promise,
    it will not resolve to the intended content.
    An easy example is for `process` to be an `async` function.
    e.g.
    ```
    async function process(content, file, done) {
       const newContent = await magic(content)
       done(newContent)
    }
    ```
    seebees committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    59ec115 View commit details
    Browse the repository at this point in the history