forked from enviPath/enviPy
Current Dev State
This commit is contained in:
34
static/js/ketcher2/node_modules/babel-plugin-transform-es2015-function-name/lib/index.js
generated
vendored
Normal file
34
static/js/ketcher2/node_modules/babel-plugin-transform-es2015-function-name/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
exports.default = function () {
|
||||
return {
|
||||
visitor: {
|
||||
FunctionExpression: {
|
||||
exit: function exit(path) {
|
||||
if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
|
||||
var replacement = (0, _babelHelperFunctionName2.default)(path);
|
||||
if (replacement) path.replaceWith(replacement);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ObjectProperty: function ObjectProperty(path) {
|
||||
var value = path.get("value");
|
||||
if (value.isFunction()) {
|
||||
var newNode = (0, _babelHelperFunctionName2.default)(value);
|
||||
if (newNode) value.replaceWith(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var _babelHelperFunctionName = require("babel-helper-function-name");
|
||||
|
||||
var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = exports["default"];
|
||||
Reference in New Issue
Block a user