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

esnext

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esnext - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

2

package.json

@@ -72,3 +72,3 @@ {

},
"version": "3.1.1"
"version": "3.1.2"
}

@@ -350,7 +350,3 @@ import * as t from 'babel-types';

function rewriteAssignmentToDefaultExport(path: Path, module: Module) {
let node = path.node;
let right = path.node.expression.right;
metadata(module).exports.push({ type: 'default-export', node: cleanNode(node) });
function getAssignmentEqualsEnd(node: Node, module: Module): number {
let equalsToken = findToken('=', module.tokensForNode(node));

@@ -361,4 +357,13 @@ let equalsEnd = equalsToken.token.end;

}
module.magicString.overwrite(path.node.start, equalsEnd, 'export default ');
return equalsEnd;
}
function rewriteAssignmentToDefaultExport(path: Path, module: Module) {
let node = path.node;
let right = path.node.expression.right;
metadata(module).exports.push({ type: 'default-export', node: cleanNode(node) });
module.magicString.overwrite(
path.node.start, getAssignmentEqualsEnd(node, module), 'export default ');
path.replaceWith(t.exportDefaultDeclaration(right));

@@ -401,3 +406,3 @@ }

// ^^^^^^^^^^^^^^ ^^^^^^^
module.magicString.overwrite(node.start, right.start, 'export ');
module.magicString.overwrite(node.start, getAssignmentEqualsEnd(node, module), 'export ');

@@ -433,3 +438,4 @@ if (!id) {

isFunctionDeclaration = false;
module.magicString.overwrite(node.start, right.start, `let ${localName} = `);
module.magicString.overwrite(
node.start, getAssignmentEqualsEnd(node, module), `let ${localName} = `);
declaration = t.variableDeclaration(

@@ -505,3 +511,4 @@ 'let',

if (localBinding === property.name) {
module.magicString.overwrite(node.start, right.start, `export let ${localBinding} = `);
module.magicString.overwrite(
node.start, getAssignmentEqualsEnd(node, module), `export let ${localBinding} = `);
replacements = [

@@ -523,3 +530,4 @@ t.exportNamedDeclaration(

} else {
module.magicString.overwrite(node.start, right.start, `let ${localBinding} = `);
module.magicString.overwrite(
node.start, getAssignmentEqualsEnd(node, module), `let ${localBinding} = `);
module.magicString.appendRight(node.end, `\nexport { ${localBinding} as ${property.name} };`);

@@ -612,3 +620,4 @@ replacements = [

// ^^^^^^^^^^^^^^ ^^^^^^^^^^^^
module.magicString.overwrite(node.start, right.start, `let ${localBinding} = `);
module.magicString.overwrite(
node.start, getAssignmentEqualsEnd(node, module), `let ${localBinding} = `);

@@ -615,0 +624,0 @@ let nodeIndex = path.parent.body.indexOf(node);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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