@babel/helper-split-export-declaration
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 = splitExportDeclaration; | ||
var t = _interopRequireWildcard(require("@babel/types")); | ||
function t() { | ||
const data = _interopRequireWildcard(require("@babel/types")); | ||
t = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
@@ -15,11 +25,11 @@ | ||
var isDefault = exportDeclaration.isExportDefaultDeclaration(); | ||
var declaration = exportDeclaration.get("declaration"); | ||
var isClassDeclaration = declaration.isClassDeclaration(); | ||
const isDefault = exportDeclaration.isExportDefaultDeclaration(); | ||
const declaration = exportDeclaration.get("declaration"); | ||
const isClassDeclaration = declaration.isClassDeclaration(); | ||
if (isDefault) { | ||
var standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration; | ||
var scope = declaration.isScope() ? declaration.scope.parent : declaration.scope; | ||
var id = declaration.node.id; | ||
var needBindingRegistration = false; | ||
const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration; | ||
const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope; | ||
let id = declaration.node.id; | ||
let needBindingRegistration = false; | ||
@@ -31,8 +41,8 @@ if (!id) { | ||
if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) { | ||
declaration.node.id = t.cloneNode(id); | ||
declaration.node.id = t().cloneNode(id); | ||
} | ||
} | ||
var updatedDeclaration = standaloneDeclaration ? declaration : t.variableDeclaration("var", [t.variableDeclarator(t.cloneNode(id), declaration.node)]); | ||
var updatedExportDeclaration = t.exportNamedDeclaration(null, [t.exportSpecifier(t.cloneNode(id), t.identifier("default"))]); | ||
const updatedDeclaration = standaloneDeclaration ? declaration : t().variableDeclaration("var", [t().variableDeclarator(t().cloneNode(id), declaration.node)]); | ||
const updatedExportDeclaration = t().exportNamedDeclaration(null, [t().exportSpecifier(t().cloneNode(id), t().identifier("default"))]); | ||
exportDeclaration.insertAfter(updatedExportDeclaration); | ||
@@ -52,7 +62,7 @@ exportDeclaration.replaceWith(updatedDeclaration); | ||
var bindingIdentifiers = declaration.getOuterBindingIdentifiers(); | ||
var specifiers = Object.keys(bindingIdentifiers).map(function (name) { | ||
return t.exportSpecifier(t.identifier(name), t.identifier(name)); | ||
const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); | ||
const specifiers = Object.keys(bindingIdentifiers).map(name => { | ||
return t().exportSpecifier(t().identifier(name), t().identifier(name)); | ||
}); | ||
var aliasDeclar = t.exportNamedDeclaration(null, specifiers); | ||
const aliasDeclar = t().exportNamedDeclaration(null, specifiers); | ||
exportDeclaration.insertAfter(aliasDeclar); | ||
@@ -59,0 +69,0 @@ exportDeclaration.replaceWith(declaration.node); |
{ | ||
"name": "@babel/helper-split-export-declaration", | ||
"version": "7.0.0-beta.42", | ||
"version": "7.0.0-beta.43", | ||
"description": "", | ||
@@ -9,4 +9,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", | ||
"dependencies": { | ||
"@babel/types": "7.0.0-beta.42" | ||
"@babel/types": "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
3541
53
+ Added@babel/types@7.0.0-beta.43(transitive)
- Removed@babel/types@7.0.0-beta.42(transitive)
Updated@babel/types@7.0.0-beta.43