Socket
Socket
Sign inDemoInstall

@adrianhelvik/hooks.macro

Package Overview
Dependencies
64
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.3 to 1.1.4

27

build/hooks.macro.js

@@ -201,7 +201,13 @@ "use strict";

Expression: function Expression(path) {
if (!t.isIdentifier(path)) {
var openingElement;
if (t.isJSXElement(path)) {
openingElement = path.node.openingElement.name;
}
if (!t.isIdentifier(path) && !t.isJSXElement(path)) {
return;
}
var binding = path.scope.getBinding(path.node.name); // Reference without a binding (such as globals) are excluded
var binding = path.scope.getBinding(openingElement ? openingElement.name : path.node.name); // Reference without a binding (such as globals) are excluded

@@ -237,3 +243,5 @@ if (binding == null) {

visitor(path);
visitor(openingElement ? {
node: openingElement
} : path);
}

@@ -246,13 +254,10 @@ });

var visitedEntryNodes = [];
var references = [];
var references = {};
visitInputsReferences(parentPath, createPath, babel, visitedEntryNodes, function (_ref) {
var node = _ref.node;
if (!references.some(function (reference) {
return reference.name === node.name;
})) {
references.push(node);
}
references[node.name] = true;
});
parentPath.replaceWith(t.callExpression(importedHookName, [createPath.node, t.arrayExpression(references)]));
parentPath.replaceWith(t.callExpression(importedHookName, [createPath.node, t.arrayExpression(Object.keys(references).map(function (name) {
return t.identifier(name);
}))]));
}

@@ -259,0 +264,0 @@

{
"name": "@adrianhelvik/hooks.macro",
"version": "1.1.3",
"version": "1.1.4",
"author": "Pier Paolo Ramon <ramonpierre@gmail.com>, Adrian Helvik <adrianhelvik100@gmail.com>",

@@ -5,0 +5,0 @@ "main": "build/hooks.macro.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc