yeet
This commit is contained in:
50
node_modules/@babel/plugin-proposal-export-default-from/lib/index.js
generated
vendored
Normal file
50
node_modules/@babel/plugin-proposal-export-default-from/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _pluginSyntaxExportDefaultFrom = _interopRequireDefault(require("@babel/plugin-syntax-export-default-from"));
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "proposal-export-default-from",
|
||||
inherits: _pluginSyntaxExportDefaultFrom.default,
|
||||
visitor: {
|
||||
ExportNamedDeclaration(path) {
|
||||
const {
|
||||
node,
|
||||
scope
|
||||
} = path;
|
||||
const {
|
||||
specifiers
|
||||
} = node;
|
||||
if (!_core.types.isExportDefaultSpecifier(specifiers[0])) return;
|
||||
const specifier = specifiers.shift();
|
||||
const {
|
||||
exported
|
||||
} = specifier;
|
||||
const uid = scope.generateUidIdentifier(exported.name);
|
||||
const nodes = [_core.types.importDeclaration([_core.types.importDefaultSpecifier(uid)], _core.types.cloneNode(node.source)), _core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(uid), exported)])];
|
||||
|
||||
if (specifiers.length >= 1) {
|
||||
nodes.push(node);
|
||||
}
|
||||
|
||||
const [importDeclaration] = path.replaceWithMultiple(nodes);
|
||||
path.scope.registerDeclaration(importDeclaration);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
Reference in New Issue
Block a user