Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hooks.macro

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hooks.macro - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

26

build/hooks.macro.js

@@ -47,2 +47,20 @@ "use strict";

function getExpressionIdentifierPath(t, expressionPath) {
if (t.isIdentifier(expressionPath)) {
return expressionPath;
} else if (t.isJSXElement(expressionPath)) {
var tagNamePath = expressionPath.get('openingElement.name');
while (t.isJSXMemberExpression(tagNamePath)) {
tagNamePath = tagNamePath.get('object');
}
if (t.isJSXIdentifier(tagNamePath)) {
return tagNamePath;
}
}
return null;
}
function isStaticKnownHookValue(t, path, binding) {

@@ -193,4 +211,6 @@ var bindingPath = binding.path;

entryPath.traverse({
Expression: function Expression(path) {
if (!t.isIdentifier(path)) {
Expression: function Expression(expressionPath) {
var path = getExpressionIdentifierPath(t, expressionPath);
if (path == null) {
return;

@@ -245,3 +265,3 @@ }

})) {
references.push(node);
references.push(t.isIdentifier(node) ? node : t.identifier(node.name));
}

@@ -248,0 +268,0 @@ });

4

package.json
{
"name": "hooks.macro",
"version": "1.1.1",
"version": "1.1.2",
"author": "Pier Paolo Ramon <ramonpierre@gmail.com>",

@@ -31,2 +31,4 @@ "main": "build/hooks.macro.js",

"@babel/core": "^7.9.0",
"@babel/plugin-syntax-do-expressions": "^7.8.3",
"@babel/plugin-syntax-jsx": "^7.8.3",
"@babel/preset-env": "^7.9.0",

@@ -33,0 +35,0 @@ "babel-core": "7.0.0-bridge.0",

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