Socket
Socket
Sign inDemoInstall

@babel/helper-wrap-function

Package Overview
Dependencies
Maintainers
6
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.14.5 to 7.15.4

19

lib/index.js

@@ -12,4 +12,13 @@ "use strict";

var t = require("@babel/types");
var _t = require("@babel/types");
const {
blockStatement,
callExpression,
functionExpression,
isAssignmentPattern,
isRestElement,
returnStatement
} = _t;
const buildAnonymousExpressionWrapper = _template.default.expression(`

@@ -45,4 +54,4 @@ (function () {

const body = node.body;
const container = t.functionExpression(null, [], t.blockStatement(body.body), true);
body.body = [t.returnStatement(t.callExpression(t.callExpression(callId, [container]), []))];
const container = functionExpression(null, [], blockStatement(body.body), true);
body.body = [returnStatement(callExpression(callExpression(callId, [container]), []))];
node.async = false;

@@ -71,3 +80,3 @@ node.generator = false;

const built = t.callExpression(callId, [node]);
const built = callExpression(callId, [node]);
const container = wrapper({

@@ -78,3 +87,3 @@ NAME: functionId || null,

PARAMS: node.params.reduce((acc, param) => {
acc.done = acc.done || t.isAssignmentPattern(param) || t.isRestElement(param);
acc.done = acc.done || isAssignmentPattern(param) || isRestElement(param);

@@ -81,0 +90,0 @@ if (!acc.done) {

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

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

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

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

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