remark-mdx
Advanced tools
Comparing version 0.17.2 to 0.17.3
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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8901
6
177
7
+ Added@babel/core@^7.2.2
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/compat-data@7.25.4(transitive)
+ Added@babel/core@7.25.2(transitive)
+ Added@babel/generator@7.25.6(transitive)
+ Added@babel/helper-compilation-targets@7.25.2(transitive)
+ Added@babel/helper-module-imports@7.24.7(transitive)
+ Added@babel/helper-module-transforms@7.25.2(transitive)
+ Added@babel/helper-plugin-utils@7.24.8(transitive)
+ Added@babel/helper-simple-access@7.24.7(transitive)
+ Added@babel/helper-string-parser@7.24.8(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/helper-validator-option@7.24.8(transitive)
+ Added@babel/helpers@7.25.6(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@babel/parser@7.25.6(transitive)
+ Added@babel/plugin-proposal-object-rest-spread@7.20.7(transitive)
+ Added@babel/plugin-syntax-jsx@7.24.7(transitive)
+ Added@babel/plugin-syntax-object-rest-spread@7.8.3(transitive)
+ Added@babel/plugin-transform-parameters@7.24.7(transitive)
+ Added@babel/template@7.25.0(transitive)
+ Added@babel/traverse@7.25.6(transitive)
+ Added@babel/types@7.25.6(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedbrowserslist@4.23.3(transitive)
+ Addedcaniuse-lite@1.0.30001660(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedelectron-to-chromium@1.5.25(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedgensync@1.0.0-beta.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@2.5.2(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednode-releases@2.0.18(transitive)
+ Addedpicocolors@1.1.0(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
+ Addedupdate-browserslist-db@1.1.0(transitive)
+ Addedyallist@3.1.1(transitive)