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.21.4-esm.2 to 7.21.4-esm.3

22

lib/index.js

@@ -1,4 +0,10 @@

import nameFunction from "@babel/helper-function-name";
import template from "@babel/template";
import * as _t from "@babel/types";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = wrapFunction;
var _helperFunctionName = require("@babel/helper-function-name");
var _template = require("@babel/template");
var _t = require("@babel/types");
const {

@@ -14,3 +20,3 @@ blockStatement,

} = _t;
const buildAnonymousExpressionWrapper = template.expression(`
const buildAnonymousExpressionWrapper = _template.default.expression(`
(function () {

@@ -23,3 +29,3 @@ var REF = FUNCTION;

`);
const buildNamedExpressionWrapper = template.expression(`
const buildNamedExpressionWrapper = _template.default.expression(`
(function () {

@@ -33,3 +39,3 @@ var REF = FUNCTION;

`);
const buildDeclarationWrapper = template.statements(`
const buildDeclarationWrapper = _template.default.statements(`
function NAME(PARAMS) { return REF.apply(this, arguments); }

@@ -98,3 +104,3 @@ function REF() {

const returnFn = container.callee.body.body[1].argument;
nameFunction({
(0, _helperFunctionName.default)({
node: returnFn,

@@ -113,3 +119,3 @@ parent: path.parent,

}
export default function wrapFunction(path, callId, noNewArrows = true, ignoreFunctionLength = false) {
function wrapFunction(path, callId, noNewArrows = true, ignoreFunctionLength = false) {
if (path.isMethod()) {

@@ -116,0 +122,0 @@ classOrObjectMethod(path, callId);

{
"name": "@babel/helper-wrap-function",
"version": "7.21.4-esm.2",
"version": "7.21.4-esm.3",
"description": "Helper to wrap functions inside a function call.",

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

"dependencies": {
"@babel/helper-function-name": "7.21.4-esm.2",
"@babel/template": "7.21.4-esm.2",
"@babel/traverse": "7.21.4-esm.2",
"@babel/types": "7.21.4-esm.2"
"@babel/helper-function-name": "7.21.4-esm.3",
"@babel/template": "7.21.4-esm.3",
"@babel/traverse": "7.21.4-esm.3",
"@babel/types": "7.21.4-esm.3"
},

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

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