New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-brahmos

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-brahmos - npm Package Compare versions

Comparing version 0.6.0-alpha5 to 0.6.0-alpha6

38

dist/index.js

@@ -212,7 +212,4 @@ 'use strict';

let attrNameStr = name.name;
const attrNameStr = name.name;
// if attribute has svg attribute mapping use that, otherwise use plain attribute
attrNameStr = SVG_ATTRIBUTE_MAP[attrNameStr] || attrNameStr;
const propName = attrNameStr.match('-|:')

@@ -421,2 +418,18 @@ ? t__default['default'].stringLiteral(attrNameStr)

// check if the node is native html element (static element)
function isHTMLNode(node) {
if (!t__default['default'].isJSXElement(node)) return false;
const tagName = node.openingElement.name.name;
/**
* We treat svg element as non html node to find the wrapping
* as svg can be converted into expression part
*/
return isHTMLElement(tagName) && tagName !== 'svg';
}
function isRenderableText(node) {
return t__default['default'].isJSXText(node) && !!cleanStringForHtml(node.value);
}
/**

@@ -443,15 +456,4 @@ * check if expression nodes are wrapped around text node, if it is than

if (!(prevNode && t__default['default'].isJSXText(prevNode))) return false;
if (!(prevNode && isRenderableText(prevNode))) return false;
const isHTMLNode = (node) => {
if (!t__default['default'].isJSXElement(node)) return false;
const tagName = node.openingElement.name.name;
/**
* We treat svg element as non html node to find the wrapping
* as svg can be converted into expression part
*/
return isHTMLElement(tagName) && tagName !== 'svg';
};
/**

@@ -463,3 +465,3 @@ * If we have consecutive expression nodes we have to ignore expression node and

while ((nextNode = children[nodeIndex + 1])) {
if (t__default['default'].isJSXText(nextNode)) {
if (isRenderableText(nextNode)) {
return true;

@@ -473,3 +475,3 @@ } else if (t__default['default'].isJSXExpressionContainer(nextNode) || !isHTMLNode(nextNode)) {

return prevNode && nextNode && t__default['default'].isJSXText(prevNode) && t__default['default'].isJSXText(nextNode);
return prevNode && nextNode && isRenderableText(prevNode) && isRenderableText(nextNode);
}

@@ -476,0 +478,0 @@

{
"name": "babel-plugin-brahmos",
"version": "0.6.0-alpha5",
"version": "0.6.0-alpha6",
"description": "Babel plugin to transform JSX to Brahmos Tagged Template literal",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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