Socket
Socket
Sign inDemoInstall

@babel/helper-wrap-function

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-wrap-function - npm Package Compare versions

Comparing version 8.0.0-alpha.11 to 8.0.0-alpha.12

18

lib/index.js

@@ -1,2 +0,1 @@

import nameFunction from '@babel/helper-function-name';
import template from '@babel/template';

@@ -48,3 +47,3 @@ import * as _t from '@babel/types';

}
function plainFunction(inPath, callId, noNewArrows, ignoreFunctionLength) {
function plainFunction(inPath, callId, noNewArrows, ignoreFunctionLength, hadName) {
let path = inPath;

@@ -81,3 +80,3 @@ let node;

NAME: functionId || null,
REF: path.scope.generateUidIdentifier(functionId ? functionId.name : "ref"),
REF: path.scope.generateUidIdentifier(hadName ? functionId.name : "ref"),
FUNCTION: built,

@@ -92,13 +91,6 @@ PARAMS: params

let container;
if (functionId) {
if (hadName) {
container = buildNamedExpressionWrapper(wrapperArgs);
} else {
container = buildAnonymousExpressionWrapper(wrapperArgs);
const returnFn = container.callee.body.body[1].argument;
nameFunction({
node: returnFn,
parent: path.parent,
scope: path.scope
});
functionId = returnFn.id;
}

@@ -116,3 +108,5 @@ if (functionId || !ignoreFunctionLength && params.length) {

} else {
plainFunction(path, callId, noNewArrows, ignoreFunctionLength);
const hadName = "id" in path.node && !!path.node.id;
path = path.ensureFunctionName(false);
plainFunction(path, callId, noNewArrows, ignoreFunctionLength, hadName);
}

@@ -119,0 +113,0 @@ }

{
"name": "@babel/helper-wrap-function",
"version": "8.0.0-alpha.11",
"version": "8.0.0-alpha.12",
"description": "Helper to wrap functions inside a function call.",

@@ -17,6 +17,5 @@ "repository": {

"dependencies": {
"@babel/helper-function-name": "^8.0.0-alpha.11",
"@babel/template": "^8.0.0-alpha.11",
"@babel/traverse": "^8.0.0-alpha.11",
"@babel/types": "^8.0.0-alpha.11"
"@babel/template": "^8.0.0-alpha.12",
"@babel/traverse": "^8.0.0-alpha.12",
"@babel/types": "^8.0.0-alpha.12"
},

@@ -23,0 +22,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

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