Skip to content

Commit

Permalink
chore: clean up some unneeded variable declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcadoo committed Dec 8, 2021
1 parent 52762e5 commit 2850016
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/actions/__tests__/serialize-mdx.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('serializes DoNotTranslate to html', async () => {
test('serializes Button to html', async () => {
const html = await serializeMDX(`
<Button
variant="primary"
variant="normal"
>
View all C SDK docs
</Button>
Expand Down
15 changes: 4 additions & 11 deletions scripts/actions/utils/serialization-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@ const serializeTextProp = (h, node, propName) => {
return;
}

const result = h(
node,
'div',
{ 'data-type': 'prop', 'data-prop': propName },
[serializeAttributeValue(h, attribute)]
);

return result;
return h(node, 'div', { 'data-type': 'prop', 'data-prop': propName }, [
serializeAttributeValue(h, attribute),
]);
};

const serializeJSValue = (value) =>
Expand Down Expand Up @@ -82,7 +77,7 @@ const serializeComponent = (
node.children = children;
const inferredTagName = node.type === 'mdxSpanElement' ? 'span' : 'div';

const result = h(
return h(
node,
tagName || inferredTagName,
stripNulls({
Expand All @@ -105,8 +100,6 @@ const serializeComponent = (
)
.filter(Boolean)
);

return result;
};

const getComponentName = (node) =>
Expand Down

0 comments on commit 2850016

Please sign in to comment.