Socket
Socket
Sign inDemoInstall

@babel/helper-split-export-declaration

Package Overview
Dependencies
Maintainers
6
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-split-export-declaration - npm Package Compare versions

Comparing version 7.0.0-beta.42 to 7.0.0-beta.43

42

lib/index.js
"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"
}
}
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