Socket
Socket
Sign inDemoInstall

babel-plugin-vtex-render-route

Package Overview
Dependencies
14
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.3.0

40

lib/index.js

@@ -71,7 +71,43 @@ 'use strict';

if (isCalleeRoute) {
path.parentPath.replaceWith(parentArguments[0]);
var _parentArguments = _slicedToArray(parentArguments, 1);
var parentArgument = _parentArguments[0];
var declaration = void 0;
switch (parentArgument.type) {
case 'FunctionExpression':
{
var id = parentArgument.id;
var params = parentArgument.params;
var body = parentArgument.body;
declaration = t.functionDeclaration(id, params, body);
break;
}
case 'ClassExpression':
{
var _id = parentArgument.id;
var superClass = parentArgument.superClass;
var _body = parentArgument.body;
declaration = t.classDeclaration(_id, superClass, _body, []);
break;
}
case 'Identifier':
{
declaration = parentArgument;
break;
}
}
path.parentPath.parentPath.remove();
state.file.path.container.program.body.push(t.exportDefaultDeclaration(declaration));
} else {
path.remove();
}
} else {
path.remove();
}
path.remove();
state.file.metadata.vtexRender = {

@@ -78,0 +114,0 @@ route: {

9

package.json
{
"name": "babel-plugin-vtex-render-route",
"version": "1.2.0",
"version": "1.3.0",
"description": "A babel plugin for extracting VTEX Render route information from a component",

@@ -10,4 +10,5 @@ "main": "lib/index.js",

"lint": "eslint src",
"test": "echo \"Error: no test specified\" && exit 1",
"prerelease": "rimraf lib && npm run lint && npm run build"
"test": "ava test/index.js --verbose",
"prerelease": "rimraf lib && npm run build && npm run lint && npm test",
"release": "npm publish"
},

@@ -39,2 +40,3 @@ "repository": {

"devDependencies": {
"ava": "^0.15.2",
"babel-cli": "^6.10.1",

@@ -44,2 +46,3 @@ "babel-core": "^6.10.4",

"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"eslint": "^2.13.1",

@@ -46,0 +49,0 @@ "eslint-config-vtex": "^4.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc