Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@babel/plugin-transform-export-namespace-from

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-export-namespace-from - npm Package Compare versions

Comparing version
8.0.0-beta.3
to
8.0.0-beta.4
+1
-1
lib/index.js

@@ -5,3 +5,3 @@ import { declare } from '@babel/helper-plugin-utils';

var index = declare(api => {
api.assertVersion("8.0.0-beta.3");
api.assertVersion("^7.0.0-0 || ^8.0.0 || 8.0.0-beta.4");
return {

@@ -8,0 +8,0 @@ name: "transform-export-namespace-from",

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"transform-export-namespace-from\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"exportNamespaceFrom\"),\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(\n // @ts-expect-error Identifier ?? StringLiteral\n exported.name ?? exported.value,\n );\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n"],"names":["declare","api","assertVersion","name","manipulateOptions","undefined","visitor","ExportNamedDeclaration","path","node","scope","specifiers","index","t","isExportDefaultSpecifier","isExportNamespaceSpecifier","nodes","push","exportNamedDeclaration","shift","source","specifier","exported","uid","generateUidIdentifier","value","importDeclaration","importNamespaceSpecifier","cloneNode","exportSpecifier","length","replaceWithMultiple","registerDeclaration"],"mappings":";;;AAGA,YAAeA,OAAO,CAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAA,cAAoB,CAAC,CAAA;EAEtC,OAAO;AACLC,IAAAA,IAAI,EAAE,iCAAiC;AACvCC,IAAAA,iBAAiB,EACbC,SACyD;AAE7DC,IAAAA,OAAO,EAAE;MACPC,sBAAsBA,CAACC,IAAI,EAAE;QAC3B,MAAM;UAAEC,IAAI;AAAEC,UAAAA,KAAAA;AAAM,SAAC,GAAGF,IAAI,CAAA;QAC5B,MAAM;AAAEG,UAAAA,UAAAA;AAAW,SAAC,GAAGF,IAAI,CAAA;AAE3B,QAAA,MAAMG,KAAK,GAAGC,KAAC,CAACC,wBAAwB,CAACH,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC/D,IAAI,CAACE,KAAC,CAACE,0BAA0B,CAACJ,UAAU,CAACC,KAAK,CAAC,CAAC,EAAE,OAAA;QAEtD,MAAMI,KAAK,GAAG,EAAE,CAAA;QAEhB,IAAIJ,KAAK,KAAK,CAAC,EAAE;UACfI,KAAK,CAACC,IAAI,CACRJ,KAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAACP,UAAU,CAACQ,KAAK,EAAE,CAAC,EAAEV,IAAI,CAACW,MAAM,CAClE,CAAC,CAAA;AACH,SAAA;AAEA,QAAA,MAAMC,SAAS,GAAGV,UAAU,CAACQ,KAAK,EAAE,CAAA;QACpC,MAAM;AAAEG,UAAAA,QAAAA;AAAS,SAAC,GAAGD,SAAS,CAAA;AAC9B,QAAA,MAAME,GAAG,GAAGb,KAAK,CAACc,qBAAqB,CAErCF,QAAQ,CAACnB,IAAI,IAAImB,QAAQ,CAACG,KAC5B,CAAC,CAAA;QAEDT,KAAK,CAACC,IAAI,CACRJ,KAAC,CAACa,iBAAiB,CACjB,CAACb,KAAC,CAACc,wBAAwB,CAACJ,GAAG,CAAC,CAAC,EACjCV,KAAC,CAACe,SAAS,CAACnB,IAAI,CAACW,MAAM,CACzB,CAAC,EACDP,KAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAC7BL,KAAC,CAACgB,eAAe,CAAChB,KAAC,CAACe,SAAS,CAACL,GAAG,CAAC,EAAED,QAAQ,CAAC,CAC9C,CACH,CAAC,CAAA;AAED,QAAA,IAAIb,IAAI,CAACE,UAAU,CAACmB,MAAM,IAAI,CAAC,EAAE;AAC/Bd,UAAAA,KAAK,CAACC,IAAI,CAACR,IAAI,CAAC,CAAA;AAClB,SAAA;QAEA,MAAM,CAACiB,iBAAiB,CAAC,GAAGlB,IAAI,CAACuB,mBAAmB,CAACf,KAAK,CAAC,CAAA;AAC3DR,QAAAA,IAAI,CAACE,KAAK,CAACsB,mBAAmB,CAACN,iBAAiB,CAAC,CAAA;AACnD,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"}
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"transform-export-namespace-from\",\n manipulateOptions: undefined,\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(\n // @ts-expect-error Identifier ?? StringLiteral\n exported.name ?? exported.value,\n );\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n"],"names":["declare","api","assertVersion","name","manipulateOptions","undefined","visitor","ExportNamedDeclaration","path","node","scope","specifiers","index","t","isExportDefaultSpecifier","isExportNamespaceSpecifier","nodes","push","exportNamedDeclaration","shift","source","specifier","exported","uid","generateUidIdentifier","value","importDeclaration","importNamespaceSpecifier","cloneNode","exportSpecifier","length","replaceWithMultiple","registerDeclaration"],"mappings":";;;AAGA,YAAeA,OAAO,CAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAA,oCAAoB,CAAC,CAAA;EAEtC,OAAO;AACLC,IAAAA,IAAI,EAAE,iCAAiC;AACvCC,IAAAA,iBAAiB,EAAEC,SAAS;AAC5BC,IAAAA,OAAO,EAAE;MACPC,sBAAsBA,CAACC,IAAI,EAAE;QAC3B,MAAM;UAAEC,IAAI;AAAEC,UAAAA,KAAAA;AAAM,SAAC,GAAGF,IAAI,CAAA;QAC5B,MAAM;AAAEG,UAAAA,UAAAA;AAAW,SAAC,GAAGF,IAAI,CAAA;AAE3B,QAAA,MAAMG,KAAK,GAAGC,KAAC,CAACC,wBAAwB,CAACH,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC/D,IAAI,CAACE,KAAC,CAACE,0BAA0B,CAACJ,UAAU,CAACC,KAAK,CAAC,CAAC,EAAE,OAAA;QAEtD,MAAMI,KAAK,GAAG,EAAE,CAAA;QAEhB,IAAIJ,KAAK,KAAK,CAAC,EAAE;UACfI,KAAK,CAACC,IAAI,CACRJ,KAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAACP,UAAU,CAACQ,KAAK,EAAE,CAAC,EAAEV,IAAI,CAACW,MAAM,CAClE,CAAC,CAAA;AACH,SAAA;AAEA,QAAA,MAAMC,SAAS,GAAGV,UAAU,CAACQ,KAAK,EAAE,CAAA;QACpC,MAAM;AAAEG,UAAAA,QAAAA;AAAS,SAAC,GAAGD,SAAS,CAAA;AAC9B,QAAA,MAAME,GAAG,GAAGb,KAAK,CAACc,qBAAqB,CAErCF,QAAQ,CAACnB,IAAI,IAAImB,QAAQ,CAACG,KAC5B,CAAC,CAAA;QAEDT,KAAK,CAACC,IAAI,CACRJ,KAAC,CAACa,iBAAiB,CACjB,CAACb,KAAC,CAACc,wBAAwB,CAACJ,GAAG,CAAC,CAAC,EACjCV,KAAC,CAACe,SAAS,CAACnB,IAAI,CAACW,MAAM,CACzB,CAAC,EACDP,KAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAC7BL,KAAC,CAACgB,eAAe,CAAChB,KAAC,CAACe,SAAS,CAACL,GAAG,CAAC,EAAED,QAAQ,CAAC,CAC9C,CACH,CAAC,CAAA;AAED,QAAA,IAAIb,IAAI,CAACE,UAAU,CAACmB,MAAM,IAAI,CAAC,EAAE;AAC/Bd,UAAAA,KAAK,CAACC,IAAI,CAACR,IAAI,CAAC,CAAA;AAClB,SAAA;QAEA,MAAM,CAACiB,iBAAiB,CAAC,GAAGlB,IAAI,CAACuB,mBAAmB,CAACf,KAAK,CAAC,CAAA;AAC3DR,QAAAA,IAAI,CAACE,KAAK,CAACsB,mBAAmB,CAACN,iBAAiB,CAAC,CAAA;AACnD,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"}
{
"name": "@babel/plugin-transform-export-namespace-from",
"version": "8.0.0-beta.3",
"version": "8.0.0-beta.4",
"description": "Compile export namespace to ES2015",

@@ -19,10 +19,10 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-beta.3"
"@babel/helper-plugin-utils": "^8.0.0-beta.4"
},
"peerDependencies": {
"@babel/core": "^8.0.0-beta.3"
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^8.0.0-beta.3",
"@babel/helper-plugin-test-runner": "^8.0.0-beta.3"
"@babel/core": "^8.0.0-beta.4",
"@babel/helper-plugin-test-runner": "^8.0.0-beta.4"
},

@@ -29,0 +29,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-export-namespace-from",