Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/docs-mdx

Package Overview
Dependencies
Maintainers
29
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/docs-mdx - npm Package Compare versions

Comparing version 0.0.1-canary.1.1f3265d.0 to 0.0.1-canary.1.4bea5cc.0

40

dist/esm/analyze.js
import * as t from '@babel/types';
import toBabel from 'estree-to-babel';
import traverse from '@babel/traverse';
import * as babelTraverse from '@babel/traverse';
import { compileSync } from '@mdx-js/mdx';

@@ -79,6 +79,42 @@ import { toEstree } from 'hast-util-to-estree';

};
/**
* This is a hack to get around inconsistencies between
* Babel's own weird interop code AND the typescript types (definitelyTyped)
* and the fact that we're using `type: "module"` in this package
* which has some weird behaviors
*/
const getTraverse = input => {
switch (true) {
case typeof input === 'function':
{
return input;
}
case typeof input.traverse === 'function':
{
return input.traverse;
}
case typeof input.default === 'function':
{
return input.default;
}
case typeof input.default.default === 'function':
{
return input.default.default;
}
default:
{
throw new Error(`Unable to get traverse function from ${input}`);
}
}
};
export const extractImports = root => {
const varToImport = {};
traverse(root, {
getTraverse(babelTraverse)(root, {
ImportDeclaration: {

@@ -85,0 +121,0 @@ enter({

2

package.json
{
"name": "@storybook/docs-mdx",
"version": "0.0.1-canary.1.1f3265d.0",
"version": "0.0.1-canary.1.4bea5cc.0",
"description": "Storybook Docs MDX analyzer",

@@ -5,0 +5,0 @@ "repository": {

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