@babel/plugin-proposal-export-namespace-from
Advanced tools
Comparing version 7.0.0-beta.42 to 7.0.0-beta.43
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
function _helperPluginUtils() { | ||
const data = require("@babel/helper-plugin-utils"); | ||
var _pluginSyntaxExportNamespaceFrom = _interopRequireDefault(require("@babel/plugin-syntax-export-namespace-from")); | ||
_helperPluginUtils = function () { | ||
return data; | ||
}; | ||
var _core = require("@babel/core"); | ||
return data; | ||
} | ||
function _pluginSyntaxExportNamespaceFrom() { | ||
const data = _interopRequireDefault(require("@babel/plugin-syntax-export-namespace-from")); | ||
_pluginSyntaxExportNamespaceFrom = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _core() { | ||
const data = require("@babel/core"); | ||
_core = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _default = (0, _helperPluginUtils.declare)(function (api) { | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
api.assertVersion(7); | ||
return { | ||
inherits: _pluginSyntaxExportNamespaceFrom.default, | ||
inherits: _pluginSyntaxExportNamespaceFrom().default, | ||
visitor: { | ||
ExportNamedDeclaration: function ExportNamedDeclaration(path) { | ||
var node = path.node, | ||
scope = path.scope; | ||
var specifiers = node.specifiers; | ||
var index = _core.types.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0; | ||
if (!_core.types.isExportNamespaceSpecifier(specifiers[index])) return; | ||
var nodes = []; | ||
ExportNamedDeclaration(path) { | ||
const { | ||
node, | ||
scope | ||
} = path; | ||
const { | ||
specifiers | ||
} = node; | ||
const index = _core().types.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0; | ||
if (!_core().types.isExportNamespaceSpecifier(specifiers[index])) return; | ||
const nodes = []; | ||
if (index === 1) { | ||
nodes.push(_core.types.exportNamedDeclaration(null, [specifiers.shift()], node.source)); | ||
nodes.push(_core().types.exportNamedDeclaration(null, [specifiers.shift()], node.source)); | ||
} | ||
var specifier = specifiers.shift(); | ||
var exported = specifier.exported; | ||
var uid = scope.generateUidIdentifier(exported.name); | ||
nodes.push(_core.types.importDeclaration([_core.types.importNamespaceSpecifier(uid)], _core.types.cloneNode(node.source)), _core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(uid), exported)])); | ||
const specifier = specifiers.shift(); | ||
const { | ||
exported | ||
} = specifier; | ||
const uid = scope.generateUidIdentifier(exported.name); | ||
nodes.push(_core().types.importDeclaration([_core().types.importNamespaceSpecifier(uid)], _core().types.cloneNode(node.source)), _core().types.exportNamedDeclaration(null, [_core().types.exportSpecifier(_core().types.cloneNode(uid), exported)])); | ||
@@ -42,2 +74,3 @@ if (node.specifiers.length >= 1) { | ||
} | ||
} | ||
@@ -44,0 +77,0 @@ }; |
{ | ||
"name": "@babel/plugin-proposal-export-namespace-from", | ||
"version": "7.0.0-beta.42", | ||
"version": "7.0.0-beta.43", | ||
"description": "Compile export namespace to ES2015", | ||
@@ -12,12 +12,12 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-namespace-from", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.42", | ||
"@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.42" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.43", | ||
"@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.43" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "7.0.0-beta.42" | ||
"@babel/core": "7.0.0-beta.43" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.42", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.42" | ||
"@babel/core": "7.0.0-beta.43", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.43" | ||
} | ||
} |
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
3509
60
+ Added@babel/code-frame@7.0.0-beta.43(transitive)
+ Added@babel/core@7.0.0-beta.43(transitive)
+ Added@babel/generator@7.0.0-beta.43(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.43(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.43(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.43(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.43(transitive)
+ Added@babel/helpers@7.0.0-beta.43(transitive)
+ Added@babel/highlight@7.0.0-beta.43(transitive)
+ Added@babel/plugin-syntax-export-namespace-from@7.0.0-beta.43(transitive)
+ Added@babel/template@7.0.0-beta.43(transitive)
+ Added@babel/traverse@7.0.0-beta.43(transitive)
+ Added@babel/types@7.0.0-beta.43(transitive)
+ Addedbabylon@7.0.0-beta.43(transitive)
- Removed@babel/code-frame@7.0.0-beta.42(transitive)
- Removed@babel/core@7.0.0-beta.42(transitive)
- Removed@babel/generator@7.0.0-beta.42(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.42(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.42(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.42(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.42(transitive)
- Removed@babel/helpers@7.0.0-beta.42(transitive)
- Removed@babel/highlight@7.0.0-beta.42(transitive)
- Removed@babel/plugin-syntax-export-namespace-from@7.0.0-beta.42(transitive)
- Removed@babel/template@7.0.0-beta.42(transitive)
- Removed@babel/traverse@7.0.0-beta.42(transitive)
- Removed@babel/types@7.0.0-beta.42(transitive)
- Removedbabylon@7.0.0-beta.42(transitive)
Updated@babel/plugin-syntax-export-namespace-from@7.0.0-beta.43