Socket
Socket
Sign inDemoInstall

@mdx-js/mdx

Package Overview
Dependencies
Maintainers
2
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdx-js/mdx - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

8

mdx-hast-to-jsx.js

@@ -8,2 +8,3 @@ function toJSX(node, parentNode = {}) {

const jsxNodes = []
let layout
for (const childNode of node.children) {

@@ -16,2 +17,7 @@ if (childNode.type === 'import') {

if (childNode.type === 'export') {
if(childNode.default) {
layout = childNode.value.replace(/^export default /, '')
continue
}
exportNodes.push(childNode)

@@ -29,3 +35,3 @@ continue

'\n' +
`export default ({components}) => <MDXTag name="wrapper">${jsxNodes
`export default ({components}) => <MDXTag name="wrapper" ${layout ? `Layout={${layout}}` : ''} components={components}>${jsxNodes
.map(childNode => toJSX(childNode, node))

@@ -32,0 +38,0 @@ .join('')}</MDXTag>`

4

package.json
{
"name": "@mdx-js/mdx",
"version": "0.9.0",
"version": "0.10.0",
"license": "MIT",

@@ -23,3 +23,3 @@ "repository": "mdx-js/mdx",

"dependencies": {
"@mdx-js/mdxast": "^0.7.2",
"@mdx-js/mdxast": "^0.10.0",
"mdast-util-to-hast": "^3.0.0",

@@ -26,0 +26,0 @@ "remark-parse": "^5.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc