Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Simplify processLayout by removing explicit promise return #32

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

zephraph
Copy link
Contributor

@zephraph zephraph commented Nov 29, 2019

This unwraps the body of processLayout from the return promise it was contained in in favor of making the function async. It's just some minor house keeping. Due to the spacing changes it's a little hard to follow what happened here.

Here's a summary:

Add async

async function processLayout(options, frontMatter, content, resourcePath, scans) {

Remove Promise return

https://github.com/hashicorp/next-mdx-enhanced/pull/32/files#diff-73f82623658278cf03c2acf12426f916L63

Convert resolve to return

return content

Convert reject to throw

if (err) throw err

Convert resolve to return

return `import layout from '${normalizeToUnixPath(layoutPath)}'

Copy link
Contributor

@jescalan jescalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the contribution @zephraph! This is great - a lot easier to process the diff in split view.

@jescalan jescalan merged commit 4a23485 into hashicorp:master Dec 2, 2019
@zephraph zephraph deleted the unwrap-process-layout branch December 3, 2019 22:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants