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
79
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 7.0.0-beta.43 to 7.0.0-beta.44

43

lib/index.js

@@ -9,5 +9,5 @@ "use strict";

function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
var data = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
_helperPluginUtils = function _helperPluginUtils() {
return data;

@@ -20,5 +20,5 @@ };

function _core() {
const data = require("@babel/core");
var data = require("@babel/core");
_core = function () {
_core = function _core() {
return data;

@@ -30,14 +30,14 @@ };

const TRACE_ID = "__source";
const FILE_NAME_VAR = "_jsxFileName";
var TRACE_ID = "__source";
var FILE_NAME_VAR = "_jsxFileName";
var _default = (0, _helperPluginUtils().declare)(api => {
var _default = (0, _helperPluginUtils().declare)(function (api) {
api.assertVersion(7);
function makeTrace(fileNameIdentifier, lineNumber) {
const fileLineLiteral = lineNumber != null ? _core().types.numericLiteral(lineNumber) : _core().types.nullLiteral();
var fileLineLiteral = lineNumber != null ? _core().types.numericLiteral(lineNumber) : _core().types.nullLiteral();
const fileNameProperty = _core().types.objectProperty(_core().types.identifier("fileName"), fileNameIdentifier);
var fileNameProperty = _core().types.objectProperty(_core().types.identifier("fileName"), fileNameIdentifier);
const lineNumberProperty = _core().types.objectProperty(_core().types.identifier("lineNumber"), fileLineLiteral);
var lineNumberProperty = _core().types.objectProperty(_core().types.identifier("lineNumber"), fileLineLiteral);

@@ -47,7 +47,7 @@ return _core().types.objectExpression([fileNameProperty, lineNumberProperty]);

const visitor = {
JSXOpeningElement(path, state) {
const id = _core().types.jsxIdentifier(TRACE_ID);
var visitor = {
JSXOpeningElement: function JSXOpeningElement(path, state) {
var id = _core().types.jsxIdentifier(TRACE_ID);
const location = path.container.openingElement.loc;
var location = path.container.openingElement.loc;

@@ -58,6 +58,6 @@ if (!location) {

const attributes = path.container.openingElement.attributes;
var attributes = path.container.openingElement.attributes;
for (let i = 0; i < attributes.length; i++) {
const name = attributes[i].name;
for (var i = 0; i < attributes.length; i++) {
var name = attributes[i].name;

@@ -70,4 +70,4 @@ if (name && name.name === TRACE_ID) {

if (!state.fileNameIdentifier) {
const fileName = state.filename || "";
const fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR);
var fileName = state.filename || "";
var fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR);
path.hub.file.scope.push({

@@ -80,9 +80,8 @@ id: fileNameIdentifier,

const trace = makeTrace(state.fileNameIdentifier, location.start.line);
var trace = makeTrace(state.fileNameIdentifier, location.start.line);
attributes.push(_core().types.jsxAttribute(id, _core().types.jsxExpressionContainer(trace)));
}
};
return {
visitor
visitor: visitor
};

@@ -89,0 +88,0 @@ });

{
"name": "@babel/plugin-transform-react-jsx-source",
"version": "7.0.0-beta.43",
"version": "7.0.0-beta.44",
"description": "Add a __source prop to all JSX Elements",

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

"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.43",
"@babel/plugin-syntax-jsx": "7.0.0-beta.43"
"@babel/helper-plugin-utils": "7.0.0-beta.44",
"@babel/plugin-syntax-jsx": "7.0.0-beta.44"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.43"
"@babel/core": "7.0.0-beta.44"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.43",
"@babel/helper-plugin-test-runner": "7.0.0-beta.43"
"@babel/core": "7.0.0-beta.44",
"@babel/helper-plugin-test-runner": "7.0.0-beta.44"
}
}
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