@babel/plugin-transform-react-display-name
Advanced tools
Comparing version 7.0.0-beta.43 to 7.0.0-beta.44
@@ -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 _path() { | ||
const data = _interopRequireDefault(require("path")); | ||
var data = _interopRequireDefault(require("path")); | ||
_path = function () { | ||
_path = function _path() { | ||
return data; | ||
@@ -31,5 +31,5 @@ }; | ||
function _core() { | ||
const data = require("@babel/core"); | ||
var data = require("@babel/core"); | ||
_core = function () { | ||
_core = function _core() { | ||
return data; | ||
@@ -43,13 +43,13 @@ }; | ||
var _default = (0, _helperPluginUtils().declare)(api => { | ||
var _default = (0, _helperPluginUtils().declare)(function (api) { | ||
api.assertVersion(7); | ||
function addDisplayName(id, call) { | ||
const props = call.arguments[0].properties; | ||
let safe = true; | ||
var props = call.arguments[0].properties; | ||
var safe = true; | ||
for (let i = 0; i < props.length; i++) { | ||
const prop = props[i]; | ||
for (var i = 0; i < props.length; i++) { | ||
var prop = props[i]; | ||
const key = _core().types.toComputedKey(prop); | ||
var key = _core().types.toComputedKey(prop); | ||
@@ -69,5 +69,7 @@ if (_core().types.isLiteral(key, { | ||
const isCreateClassCallExpression = _core().types.buildMatchMemberExpression("React.createClass"); | ||
var isCreateClassCallExpression = _core().types.buildMatchMemberExpression("React.createClass"); | ||
const isCreateClassAddon = callee => callee.name === "createReactClass"; | ||
var isCreateClassAddon = function isCreateClassAddon(callee) { | ||
return callee.name === "createReactClass"; | ||
}; | ||
@@ -81,5 +83,5 @@ function isCreateClass(node) { | ||
const args = node.arguments; | ||
var args = node.arguments; | ||
if (args.length !== 1) return false; | ||
const first = args[0]; | ||
var first = args[0]; | ||
if (!_core().types.isObjectExpression(first)) return false; | ||
@@ -91,9 +93,9 @@ return true; | ||
visitor: { | ||
ExportDefaultDeclaration({ | ||
node | ||
}, state) { | ||
ExportDefaultDeclaration: function ExportDefaultDeclaration(_ref, state) { | ||
var node = _ref.node; | ||
if (isCreateClass(node.declaration)) { | ||
const filename = state.filename || "unknown"; | ||
var filename = state.filename || "unknown"; | ||
let displayName = _path().default.basename(filename, _path().default.extname(filename)); | ||
var displayName = _path().default.basename(filename, _path().default.extname(filename)); | ||
@@ -107,9 +109,6 @@ if (displayName === "index") { | ||
}, | ||
CallExpression(path) { | ||
const { | ||
node | ||
} = path; | ||
CallExpression: function CallExpression(path) { | ||
var node = path.node; | ||
if (!isCreateClass(node)) return; | ||
let id; | ||
var id; | ||
path.find(function (path) { | ||
@@ -138,3 +137,2 @@ if (path.isAssignmentExpression()) { | ||
} | ||
} | ||
@@ -141,0 +139,0 @@ }; |
{ | ||
"name": "@babel/plugin-transform-react-display-name", | ||
"version": "7.0.0-beta.43", | ||
"version": "7.0.0-beta.44", | ||
"description": "Add displayName to React.createClass calls", | ||
@@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.43" | ||
"@babel/helper-plugin-utils": "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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4726
101
+ Added@babel/code-frame@7.0.0-beta.44(transitive)
+ Added@babel/core@7.0.0-beta.44(transitive)
+ Added@babel/generator@7.0.0-beta.44(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.44(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.44(transitive)
+ Added@babel/helper-plugin-utils@7.0.0-beta.44(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.44(transitive)
+ Added@babel/helpers@7.0.0-beta.44(transitive)
+ Added@babel/highlight@7.0.0-beta.44(transitive)
+ Added@babel/template@7.0.0-beta.44(transitive)
+ Added@babel/traverse@7.0.0-beta.44(transitive)
+ Added@babel/types@7.0.0-beta.44(transitive)
+ Addedbabylon@7.0.0-beta.44(transitive)
- Removed@babel/code-frame@7.0.0-beta.43(transitive)
- Removed@babel/core@7.0.0-beta.43(transitive)
- Removed@babel/generator@7.0.0-beta.43(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.43(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.43(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.43(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.43(transitive)
- Removed@babel/helpers@7.0.0-beta.43(transitive)
- Removed@babel/highlight@7.0.0-beta.43(transitive)
- Removed@babel/template@7.0.0-beta.43(transitive)
- Removed@babel/traverse@7.0.0-beta.43(transitive)
- Removed@babel/types@7.0.0-beta.43(transitive)
- Removedbabylon@7.0.0-beta.43(transitive)