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 7.24.7 to 7.25.0

22

lib/index.js

@@ -7,3 +7,2 @@ "use strict";

exports.default = wrapFunction;
var _helperFunctionName = require("@babel/helper-function-name");
var _template = require("@babel/template");

@@ -54,3 +53,3 @@ var _t = require("@babel/types");

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

@@ -88,3 +87,3 @@ let node;

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

@@ -99,13 +98,6 @@ PARAMS: params

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

@@ -123,3 +115,9 @@ if (functionId || !ignoreFunctionLength && params.length) {

} else {
plainFunction(path, callId, noNewArrows, ignoreFunctionLength);
const hadName = "id" in path.node && !!path.node.id;
{
var _path, _path$ensureFunctionN;
(_path$ensureFunctionN = (_path = path).ensureFunctionName) != null ? _path$ensureFunctionN : _path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path = path.ensureFunctionName(false);
plainFunction(path, callId, noNewArrows, ignoreFunctionLength, hadName);
}

@@ -126,0 +124,0 @@ }

{
"name": "@babel/helper-wrap-function",
"version": "7.24.7",
"version": "7.25.0",
"description": "Helper to wrap functions inside a function call.",

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

"dependencies": {
"@babel/helper-function-name": "^7.24.7",
"@babel/template": "^7.24.7",
"@babel/traverse": "^7.24.7",
"@babel/types": "^7.24.7"
"@babel/template": "^7.25.0",
"@babel/traverse": "^7.25.0",
"@babel/types": "^7.25.0"
},

@@ -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