Skip to content

Commit

Permalink
Renamed variables after PR Review
Browse files Browse the repository at this point in the history
- `hasLayout` -> `hasInternalLayout`
- `consequent` -> `result`
  • Loading branch information
0phoff committed Jun 14, 2022
1 parent a5cf6a0 commit 2e7267c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/mdx/lib/plugin/recma-document.js
Expand Up @@ -481,10 +481,10 @@ export function recmaDocument(options = {}) {

/**
* @param {Expression} [content]
* @param {boolean} [hasLayout]
* @param {boolean} [hasInternalLayout]
* @returns {FunctionDeclaration[]}
*/
function createMdxContent(content, hasLayout) {
function createMdxContent(content, hasInternalLayout) {
/** @type {JSXElement} */
const element = {
type: 'JSXElement',
Expand Down Expand Up @@ -524,13 +524,13 @@ export function recmaDocument(options = {}) {
}

// @ts-expect-error: JSXElements are expressions.
let consequent = /** @type {Expression} */ (element)
let result = /** @type {Expression} */ (element)

if (!hasLayout) {
consequent = {
if (!hasInternalLayout) {
result = {
type: 'ConditionalExpression',
test: {type: 'Identifier', name: 'MDXLayout'},
consequent,
consequent: result,
alternate: {
type: 'CallExpression',
callee: {type: 'Identifier', name: '_createMdxContent'},
Expand Down Expand Up @@ -580,7 +580,7 @@ export function recmaDocument(options = {}) {
body: [
{
type: 'ReturnStatement',
argument: consequent
argument: result
}
]
}
Expand Down

0 comments on commit 2e7267c

Please sign in to comment.