You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@babel/plugin-proposal-function-sent

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.21.4-esm.4 to 7.22.5

33

lib/index.js

@@ -1,13 +0,19 @@

import { declare } from "@babel/helper-plugin-utils";
import syntaxFunctionSent from "@babel/plugin-syntax-function-sent";
import wrapFunction from "@babel/helper-wrap-function";
import { types as t } from "@babel/core";
export default declare(api => {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _pluginSyntaxFunctionSent = require("@babel/plugin-syntax-function-sent");
var _helperWrapFunction = require("@babel/helper-wrap-function");
var _core = require("@babel/core");
var _default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
const isFunctionSent = node => t.isIdentifier(node.meta, {
const isFunctionSent = node => _core.types.isIdentifier(node.meta, {
name: "function"
}) && t.isIdentifier(node.property, {
}) && _core.types.isIdentifier(node.property, {
name: "sent"
});
const hasBeenReplaced = (node, sentId) => t.isAssignmentExpression(node) && t.isIdentifier(node.left, {
const hasBeenReplaced = (node, sentId) => _core.types.isAssignmentExpression(node) && _core.types.isIdentifier(node.left, {
name: sentId

@@ -21,3 +27,3 @@ });

if (!hasBeenReplaced(path.parent, this.sentId)) {
path.replaceWith(t.assignmentExpression("=", t.identifier(this.sentId), path.node));
path.replaceWith(_core.types.assignmentExpression("=", _core.types.identifier(this.sentId), path.node));
}

@@ -27,3 +33,3 @@ },

if (isFunctionSent(path.node)) {
path.replaceWith(t.identifier(this.sentId));
path.replaceWith(_core.types.identifier(this.sentId));
}

@@ -34,3 +40,3 @@ }

name: "proposal-function-sent",
inherits: syntaxFunctionSent,
inherits: _pluginSyntaxFunctionSent.default,
visitor: {

@@ -47,4 +53,4 @@ MetaProperty(path, state) {

});
fnPath.node.body.body.unshift(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(sentId), t.yieldExpression())]));
wrapFunction(fnPath, state.addHelper("skipFirstGeneratorNext"));
fnPath.node.body.body.unshift(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.identifier(sentId), _core.types.yieldExpression())]));
(0, _helperWrapFunction.default)(fnPath, state.addHelper("skipFirstGeneratorNext"));
}

@@ -54,3 +60,4 @@ }

});
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-proposal-function-sent",
"version": "7.21.4-esm.4",
"version": "7.22.5",
"description": "Compile the function.sent meta property to valid ES2015 code",

@@ -20,12 +20,12 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "7.21.4-esm.4",
"@babel/helper-wrap-function": "7.21.4-esm.4",
"@babel/plugin-syntax-function-sent": "7.21.4-esm.4"
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/helper-wrap-function": "^7.22.5",
"@babel/plugin-syntax-function-sent": "^7.22.5"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0 || ^7.21.4-esm.2"
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "7.21.4-esm.4",
"@babel/helper-plugin-test-runner": "7.21.4-esm.4"
"@babel/core": "^7.22.5",
"@babel/helper-plugin-test-runner": "^7.22.5"
},

@@ -36,3 +36,3 @@ "engines": {

"author": "The Babel Team (https://babel.dev/team)",
"type": "module"
"type": "commonjs"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc