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

babel-plugin-transform-react-jsx-source

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-jsx-source - npm Package Compare versions

Comparing version 6.8.0 to 6.9.0

24

lib/index.js

@@ -17,2 +17,18 @@ /*istanbul ignore next*/"use strict";

JSXOpeningElement: function JSXOpeningElement(path, state) {
var id = t.jSXIdentifier(TRACE_ID);
var location = path.container.openingElement.loc;
if (!location) {
// the element was generated and doesn't have location information
return;
}
var attributes = path.container.openingElement.attributes;
for (var i = 0; i < attributes.length; i++) {
var name = attributes[i].name;
if (name && name.name === TRACE_ID) {
// The __source attibute already exists
return;
}
}
if (!state.fileNameIdentifier) {

@@ -26,8 +42,4 @@ var fileName = state.file.log.filename !== "unknown" ? state.file.log.filename : null;

var id = t.jSXIdentifier(TRACE_ID);
var location = path.container.openingElement.loc; // undefined for generated elements
if (location) {
var trace = makeTrace(state.fileNameIdentifier, location.start.line);
path.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
var trace = makeTrace(state.fileNameIdentifier, location.start.line);
attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}

@@ -34,0 +46,0 @@ };

{
"name": "babel-plugin-transform-react-jsx-source",
"version": "6.8.0",
"version": "6.9.0",
"description": "Add a __source prop to all JSX Elements",

@@ -12,3 +12,3 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source",

"dependencies": {
"babel-runtime": "^6.0.0",
"babel-runtime": "^6.9.0",
"babel-plugin-syntax-jsx": "^6.8.0"

@@ -15,0 +15,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