Socket
Socket
Sign inDemoInstall

remark-mdx

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-mdx - npm Package Compare versions

Comparing version 0.17.2 to 0.17.3

extract-imports-and-exports.js

19

index.js
const isAlphabetical = require('is-alphabetical')
const extractImportsAndExports = require('./extract-imports-and-exports')
const {tag} = require('./tag')

@@ -6,3 +7,2 @@

const EXPORT_REGEX = /^export/
const EXPORT_DEFAULT_REGEX = /^export\s+default\s+/
const EMPTY_NEWLINE = '\n\n'

@@ -15,3 +15,2 @@ const LESS_THAN = '<'

const isExport = text => EXPORT_REGEX.test(text)
const isExportDefault = text => EXPORT_DEFAULT_REGEX.test(text)

@@ -107,16 +106,6 @@ module.exports = mdx

if (isExport(subvalue)) {
return eat(subvalue)({
type: 'export',
default: isExportDefault(subvalue),
value: subvalue
})
if (isExport(subvalue) || isImport(subvalue)) {
const nodes = extractImportsAndExports(subvalue)
nodes.map(node => eat(node.value)(node))
}
if (isImport(subvalue)) {
return eat(subvalue)({
type: 'import',
value: subvalue
})
}
}

@@ -123,0 +112,0 @@

{
"name": "remark-mdx",
"version": "0.17.2",
"version": "0.17.3",
"description": "Support import, export, and JSX in markdown",

@@ -26,5 +26,10 @@ "license": "MIT",

"index.js",
"tag.js"
"tag.js",
"extract-imports-and-exports.js"
],
"dependencies": {
"@babel/core": "^7.2.2",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
"@babel/plugin-syntax-jsx": "^7.2.0",
"is-alphabetical": "^1.0.2",

@@ -44,3 +49,3 @@ "remark-parse": "^6.0.0",

},
"gitHead": "14d9b19a8998cf39c0e09acceadfc03041a9a128"
"gitHead": "d987df9b31447eae1aed5431c7ac8129fffa4e3a"
}
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