babel-plugin-transform-react-jsx-source
Advanced tools
Comparing version 6.1.4 to 6.1.17
@@ -18,4 +18,2 @@ | ||
var _Object$keys = require("babel-runtime/core-js/object/keys")["default"]; | ||
var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"]; | ||
@@ -34,21 +32,8 @@ | ||
function objectToAst(object) { | ||
var properties = _Object$keys(object).map(function (attr) { | ||
var value = undefined; | ||
switch (typeof object[attr]) { | ||
case "number": | ||
value = t.numericLiteral(object[attr]);break; | ||
default: | ||
value = t.stringLiteral(object[attr].toString()); | ||
} | ||
return t.objectProperty(t.identifier(attr), value); | ||
}); | ||
return t.objectExpression(properties); | ||
} | ||
function makeTrace(fileName, lineNumber) { | ||
return objectToAst({ | ||
fileName: fileName, | ||
lineNumber: lineNumber | ||
}); | ||
var fileNameLiteral = fileName != null ? t.stringLiteral(fileName) : t.nullLiteral(); | ||
var fileLineLiteral = lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral(); | ||
var fileNameProperty = t.objectProperty(t.identifier("fileName"), fileNameLiteral); | ||
var lineNumberProperty = t.objectProperty(t.identifier("lineNumber"), fileLineLiteral); | ||
return t.objectExpression([fileNameProperty, lineNumberProperty]); | ||
} | ||
@@ -55,0 +40,0 @@ |
{ | ||
"name": "babel-plugin-transform-react-jsx-source", | ||
"version": "6.1.4", | ||
"version": "6.1.17", | ||
"description": "Add a __source prop to all JSX Elements", | ||
@@ -13,7 +13,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source", | ||
"babel-runtime": "^5.0.0", | ||
"babel-plugin-syntax-jsx": "^6.1.4" | ||
"babel-plugin-syntax-jsx": "^6.1.17" | ||
}, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "^6.1.4" | ||
"babel-helper-plugin-test-runner": "^6.1.17" | ||
} | ||
} |
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
2725
40