Commit ac419aba authored by Cholgrrr's avatar Cholgrrr
Browse files

.gitignore, settings.json und 14061 weitere dateien aktualisiert...

parent ed14b8b4
# @babel/plugin-transform-modules-systemjs
> This plugin transforms ES2015 modules to SystemJS
See our website [@babel/plugin-transform-modules-systemjs](https://babeljs.io/docs/en/next/babel-plugin-transform-modules-systemjs.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-modules-systemjs
```
or using yarn:
```sh
yarn add @babel/plugin-transform-modules-systemjs --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperHoistVariables = _interopRequireDefault(require("@babel/helper-hoist-variables"));
var _core = require("@babel/core");
var _utils = require("babel-plugin-dynamic-import-node/utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const buildTemplate = (0, _core.template)(`
SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {
"use strict";
BEFORE_BODY;
return {
setters: SETTERS,
execute: function () {
BODY;
}
};
});
`);
const buildExportAll = (0, _core.template)(`
for (var KEY in TARGET) {
if (KEY !== "default" && KEY !== "__esModule") EXPORT_OBJ[KEY] = TARGET[KEY];
}
`);
const MISSING_PLUGIN_WARNING = `\
WARNING: Dynamic import() transformation must be enabled using the
@babel/plugin-proposal-dynamic-import plugin. Babel 8 will
no longer transform import() without using that plugin.
`;
function constructExportCall(path, exportIdent, exportNames, exportValues, exportStarTarget) {
const statements = [];
if (exportNames.length === 1) {
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.stringLiteral(exportNames[0]), exportValues[0]])));
} else if (!exportStarTarget) {
const objectProperties = [];
for (let i = 0; i < exportNames.length; i++) {
const exportName = exportNames[i];
const exportValue = exportValues[i];
objectProperties.push(_core.types.objectProperty(_core.types.identifier(exportName), exportValue));
}
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.objectExpression(objectProperties)])));
} else {
const exportObj = path.scope.generateUid("exportObj");
statements.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(_core.types.identifier(exportObj), _core.types.objectExpression([]))]));
statements.push(buildExportAll({
KEY: path.scope.generateUidIdentifier("key"),
EXPORT_OBJ: _core.types.identifier(exportObj),
TARGET: exportStarTarget
}));
for (let i = 0; i < exportNames.length; i++) {
const exportName = exportNames[i];
const exportValue = exportValues[i];
statements.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportObj), _core.types.identifier(exportName)), exportValue)));
}
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.identifier(exportObj)])));
}
return statements;
}
var _default = (0, _helperPluginUtils.declare)((api, options) => {
api.assertVersion(7);
const {
systemGlobal = "System"
} = options;
const IGNORE_REASSIGNMENT_SYMBOL = Symbol();
const reassignmentVisitor = {
"AssignmentExpression|UpdateExpression"(path) {
if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;
path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;
const arg = path.get(path.isAssignmentExpression() ? "left" : "argument");
if (arg.isObjectPattern() || arg.isArrayPattern()) {
const exprs = [path.node];
for (const name of Object.keys(arg.getBindingIdentifiers())) {
if (this.scope.getBinding(name) !== path.scope.getBinding(name)) {
return;
}
const exportedNames = this.exports[name];
if (!exportedNames) return;
for (const exportedName of exportedNames) {
exprs.push(this.buildCall(exportedName, _core.types.identifier(name)).expression);
}
}
path.replaceWith(_core.types.sequenceExpression(exprs));
return;
}
if (!arg.isIdentifier()) return;
const name = arg.node.name;
if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
const exportedNames = this.exports[name];
if (!exportedNames) return;
let node = path.node;
const isPostUpdateExpression = path.isUpdateExpression({
prefix: false
});
if (isPostUpdateExpression) {
node = _core.types.binaryExpression(node.operator[0], _core.types.unaryExpression("+", _core.types.cloneNode(node.argument)), _core.types.numericLiteral(1));
}
for (const exportedName of exportedNames) {
node = this.buildCall(exportedName, node).expression;
}
if (isPostUpdateExpression) {
node = _core.types.sequenceExpression([node, path.node]);
}
path.replaceWith(node);
}
};
return {
name: "transform-modules-systemjs",
pre() {
this.file.set("@babel/plugin-transform-modules-*", "systemjs");
},
visitor: {
CallExpression(path, state) {
if (_core.types.isImport(path.node.callee)) {
if (!this.file.has("@babel/plugin-proposal-dynamic-import")) {
console.warn(MISSING_PLUGIN_WARNING);
}
path.replaceWith(_core.types.callExpression(_core.types.memberExpression(_core.types.identifier(state.contextIdent), _core.types.identifier("import")), [(0, _utils.getImportSource)(_core.types, path.node)]));
}
},
MetaProperty(path, state) {
if (path.node.meta.name === "import" && path.node.property.name === "meta") {
path.replaceWith(_core.types.memberExpression(_core.types.identifier(state.contextIdent), _core.types.identifier("meta")));
}
},
ReferencedIdentifier(path, state) {
if (path.node.name === "__moduleName" && !path.scope.hasBinding("__moduleName")) {
path.replaceWith(_core.types.memberExpression(_core.types.identifier(state.contextIdent), _core.types.identifier("id")));
}
},
Program: {
enter(path, state) {
state.contextIdent = path.scope.generateUid("context");
},
exit(path, state) {
const undefinedIdent = path.scope.buildUndefinedNode();
const exportIdent = path.scope.generateUid("export");
const contextIdent = state.contextIdent;
const exportMap = Object.create(null);
const modules = [];
let beforeBody = [];
const setters = [];
const sources = [];
const variableIds = [];
const removedPaths = [];
function addExportName(key, val) {
exportMap[key] = exportMap[key] || [];
exportMap[key].push(val);
}
function pushModule(source, key, specifiers) {
let module;
modules.forEach(function (m) {
if (m.key === source) {
module = m;
}
});
if (!module) {
modules.push(module = {
key: source,
imports: [],
exports: []
});
}
module[key] = module[key].concat(specifiers);
}
function buildExportCall(name, val) {
return _core.types.expressionStatement(_core.types.callExpression(_core.types.identifier(exportIdent), [_core.types.stringLiteral(name), val]));
}
const exportNames = [];
const exportValues = [];
const body = path.get("body");
for (const path of body) {
if (path.isFunctionDeclaration()) {
beforeBody.push(path.node);
removedPaths.push(path);
} else if (path.isClassDeclaration()) {
variableIds.push(path.node.id);
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(path.node.id), _core.types.toExpression(path.node))));
} else if (path.isImportDeclaration()) {
const source = path.node.source.value;
pushModule(source, "imports", path.node.specifiers);
for (const name of Object.keys(path.getBindingIdentifiers())) {
path.scope.removeBinding(name);
variableIds.push(_core.types.identifier(name));
}
path.remove();
} else if (path.isExportAllDeclaration()) {
pushModule(path.node.source.value, "exports", path.node);
path.remove();
} else if (path.isExportDefaultDeclaration()) {
const declar = path.get("declaration");
const id = declar.node.id;
if (declar.isClassDeclaration()) {
if (id) {
exportNames.push("default");
exportValues.push(undefinedIdent);
variableIds.push(id);
addExportName(id.name, "default");
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(id), _core.types.toExpression(declar.node))));
} else {
exportNames.push("default");
exportValues.push(_core.types.toExpression(declar.node));
removedPaths.push(path);
}
} else if (declar.isFunctionDeclaration()) {
if (id) {
beforeBody.push(declar.node);
exportNames.push("default");
exportValues.push(_core.types.cloneNode(id));
addExportName(id.name, "default");
} else {
exportNames.push("default");
exportValues.push(_core.types.toExpression(declar.node));
}
removedPaths.push(path);
} else {
path.replaceWith(buildExportCall("default", declar.node));
}
} else if (path.isExportNamedDeclaration()) {
const declar = path.get("declaration");
if (declar.node) {
path.replaceWith(declar);
if (path.isFunction()) {
const node = declar.node;
const name = node.id.name;
addExportName(name, name);
beforeBody.push(node);
exportNames.push(name);
exportValues.push(_core.types.cloneNode(node.id));
removedPaths.push(path);
} else if (path.isClass()) {
const name = declar.node.id.name;
exportNames.push(name);
exportValues.push(undefinedIdent);
variableIds.push(declar.node.id);
path.replaceWith(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(declar.node.id), _core.types.toExpression(declar.node))));
addExportName(name, name);
} else {
for (const name of Object.keys(declar.getBindingIdentifiers())) {
addExportName(name, name);
}
}
} else {
const specifiers = path.node.specifiers;
if (specifiers && specifiers.length) {
if (path.node.source) {
pushModule(path.node.source.value, "exports", specifiers);
path.remove();
} else {
const nodes = [];
for (const specifier of specifiers) {
const binding = path.scope.getBinding(specifier.local.name);
if (binding && _core.types.isFunctionDeclaration(binding.path.node)) {
exportNames.push(specifier.exported.name);
exportValues.push(_core.types.cloneNode(specifier.local));
} else if (!binding) {
nodes.push(buildExportCall(specifier.exported.name, specifier.local));
}
addExportName(specifier.local.name, specifier.exported.name);
}
path.replaceWithMultiple(nodes);
}
} else {
path.remove();
}
}
}
}
modules.forEach(function (specifiers) {
let setterBody = [];
const target = path.scope.generateUid(specifiers.key);
for (let specifier of specifiers.imports) {
if (_core.types.isImportNamespaceSpecifier(specifier)) {
setterBody.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", specifier.local, _core.types.identifier(target))));
} else if (_core.types.isImportDefaultSpecifier(specifier)) {
specifier = _core.types.importSpecifier(specifier.local, _core.types.identifier("default"));
}
if (_core.types.isImportSpecifier(specifier)) {
setterBody.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", specifier.local, _core.types.memberExpression(_core.types.identifier(target), specifier.imported))));
}
}
if (specifiers.exports.length) {
const exportNames = [];
const exportValues = [];
let hasExportStar = false;
for (const node of specifiers.exports) {
if (_core.types.isExportAllDeclaration(node)) {
hasExportStar = true;
} else if (_core.types.isExportSpecifier(node)) {
exportNames.push(node.exported.name);
exportValues.push(_core.types.memberExpression(_core.types.identifier(target), node.local));
} else {}
}
setterBody = setterBody.concat(constructExportCall(path, _core.types.identifier(exportIdent), exportNames, exportValues, hasExportStar ? _core.types.identifier(target) : null));
}
sources.push(_core.types.stringLiteral(specifiers.key));
setters.push(_core.types.functionExpression(null, [_core.types.identifier(target)], _core.types.blockStatement(setterBody)));
});
let moduleName = this.getModuleName();
if (moduleName) moduleName = _core.types.stringLiteral(moduleName);
(0, _helperHoistVariables.default)(path, (id, name, hasInit) => {
variableIds.push(id);
if (!hasInit) {
exportNames.push(name);
exportValues.push(undefinedIdent);
}
}, null);
if (variableIds.length) {
beforeBody.unshift(_core.types.variableDeclaration("var", variableIds.map(id => _core.types.variableDeclarator(id))));
}
if (exportNames.length) {
beforeBody = beforeBody.concat(constructExportCall(path, _core.types.identifier(exportIdent), exportNames, exportValues, null));
}
path.traverse(reassignmentVisitor, {
exports: exportMap,
buildCall: buildExportCall,
scope: path.scope
});
for (const path of removedPaths) {
path.remove();
}
path.node.body = [buildTemplate({
SYSTEM_REGISTER: _core.types.memberExpression(_core.types.identifier(systemGlobal), _core.types.identifier("register")),
BEFORE_BODY: beforeBody,
MODULE_NAME: moduleName,
SETTERS: _core.types.arrayExpression(setters),
SOURCES: _core.types.arrayExpression(sources),
BODY: path.node.body,
EXPORT_IDENTIFIER: _core.types.identifier(exportIdent),
CONTEXT_IDENTIFIER: _core.types.identifier(contextIdent)
})];
}
}
}
};
});
exports.default = _default;
\ No newline at end of file
{
"name": "@babel/plugin-transform-modules-systemjs",
"version": "7.7.0",
"description": "This plugin transforms ES2015 modules to SystemJS",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"dependencies": {
"@babel/helper-hoist-variables": "^7.7.0",
"@babel/helper-plugin-utils": "^7.0.0",
"babel-plugin-dynamic-import-node": "^2.3.0"
},
"keywords": [
"babel-plugin"
],
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/helper-plugin-test-runner": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0"
},
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
}
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @babel/plugin-transform-modules-umd
> This plugin transforms ES2015 modules to UMD
See our website [@babel/plugin-transform-modules-umd](https://babeljs.io/docs/en/next/babel-plugin-transform-modules-umd.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-modules-umd
```
or using yarn:
```sh
yarn add @babel/plugin-transform-modules-umd --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _path = require("path");
var _helperModuleTransforms = require("@babel/helper-module-transforms");
var _core = require("@babel/core");
const buildPrerequisiteAssignment = (0, _core.template)(`
GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}
`);
const buildWrapper = (0, _core.template)(`
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(MODULE_NAME, AMD_ARGUMENTS, factory);
} else if (typeof exports !== "undefined") {
factory(COMMONJS_ARGUMENTS);
} else {
var mod = { exports: {} };
factory(BROWSER_ARGUMENTS);
GLOBAL_TO_ASSIGN;
}
})(
typeof globalThis === "object" ? globalThis
: typeof self === "object" ? self
: this,
function(IMPORT_NAMES) {
})
`);
var _default = (0, _helperPluginUtils.declare)((api, options) => {
api.assertVersion(7);
const {
globals,
exactGlobals,
loose,
allowTopLevelThis,
strict,
strictMode,
noInterop
} = options;
function buildBrowserInit(browserGlobals, exactGlobals, filename, moduleName) {
const moduleNameOrBasename = moduleName ? moduleName.value : (0, _path.basename)(filename, (0, _path.extname)(filename));
let globalToAssign = _core.types.memberExpression(_core.types.identifier("global"), _core.types.identifier(_core.types.toIdentifier(moduleNameOrBasename)));
let initAssignments = [];
if (exactGlobals) {
const globalName = browserGlobals[moduleNameOrBasename];
if (globalName) {
initAssignments = [];
const members = globalName.split(".");
globalToAssign = members.slice(1).reduce((accum, curr) => {
initAssignments.push(buildPrerequisiteAssignment({
GLOBAL_REFERENCE: _core.types.cloneNode(accum)
}));
return _core.types.memberExpression(accum, _core.types.identifier(curr));
}, _core.types.memberExpression(_core.types.identifier("global"), _core.types.identifier(members[0])));
}
}
initAssignments.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", globalToAssign, _core.types.memberExpression(_core.types.identifier("mod"), _core.types.identifier("exports")))));
return initAssignments;
}
function buildBrowserArg(browserGlobals, exactGlobals, source) {
let memberExpression;
if (exactGlobals) {
const globalRef = browserGlobals[source];
if (globalRef) {
memberExpression = globalRef.split(".").reduce((accum, curr) => _core.types.memberExpression(accum, _core.types.identifier(curr)), _core.types.identifier("global"));
} else {
memberExpression = _core.types.memberExpression(_core.types.identifier("global"), _core.types.identifier(_core.types.toIdentifier(source)));
}
} else {
const requireName = (0, _path.basename)(source, (0, _path.extname)(source));
const globalName = browserGlobals[requireName] || requireName;
memberExpression = _core.types.memberExpression(_core.types.identifier("global"), _core.types.identifier(_core.types.toIdentifier(globalName)));
}
return memberExpression;
}
return {
name: "transform-modules-umd",
visitor: {
Program: {
exit(path) {
if (!(0, _helperModuleTransforms.isModule)(path)) return;
const browserGlobals = globals || {};
let moduleName = this.getModuleName();
if (moduleName) moduleName = _core.types.stringLiteral(moduleName);
const {
meta,
headers
} = (0, _helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path, {
loose,
strict,
strictMode,
allowTopLevelThis,
noInterop
});
const amdArgs = [];
const commonjsArgs = [];
const browserArgs = [];
const importNames = [];
if ((0, _helperModuleTransforms.hasExports)(meta)) {
amdArgs.push(_core.types.stringLiteral("exports"));
commonjsArgs.push(_core.types.identifier("exports"));
browserArgs.push(_core.types.memberExpression(_core.types.identifier("mod"), _core.types.identifier("exports")));
importNames.push(_core.types.identifier(meta.exportName));
}
for (const [source, metadata] of meta.source) {
amdArgs.push(_core.types.stringLiteral(source));
commonjsArgs.push(_core.types.callExpression(_core.types.identifier("require"), [_core.types.stringLiteral(source)]));
browserArgs.push(buildBrowserArg(browserGlobals, exactGlobals, source));
importNames.push(_core.types.identifier(metadata.name));
if (!(0, _helperModuleTransforms.isSideEffectImport)(metadata)) {
const interop = (0, _helperModuleTransforms.wrapInterop)(path, _core.types.identifier(metadata.name), metadata.interop);
if (interop) {
const header = _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.identifier(metadata.name), interop));
header.loc = meta.loc;
headers.push(header);
}
}
headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, loose));
}
(0, _helperModuleTransforms.ensureStatementsHoisted)(headers);
path.unshiftContainer("body", headers);
const {
body,
directives
} = path.node;
path.node.directives = [];
path.node.body = [];
const umdWrapper = path.pushContainer("body", [buildWrapper({
MODULE_NAME: moduleName,
AMD_ARGUMENTS: _core.types.arrayExpression(amdArgs),
COMMONJS_ARGUMENTS: commonjsArgs,
BROWSER_ARGUMENTS: browserArgs,
IMPORT_NAMES: importNames,
GLOBAL_TO_ASSIGN: buildBrowserInit(browserGlobals, exactGlobals, this.filename || "unknown", moduleName)
})])[0];
const umdFactory = umdWrapper.get("expression.arguments")[1].get("body");
umdFactory.pushContainer("directives", directives);
umdFactory.pushContainer("body", body);
}
}
}
};
});
exports.default = _default;
\ No newline at end of file
{
"name": "@babel/plugin-transform-modules-umd",
"version": "7.7.0",
"description": "This plugin transforms ES2015 modules to UMD",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"dependencies": {
"@babel/helper-module-transforms": "^7.7.0",
"@babel/helper-plugin-utils": "^7.0.0"
},
"keywords": [
"babel-plugin"
],
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/helper-plugin-test-runner": "^7.0.0"
},
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
}
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @babel/plugin-transform-named-capturing-groups-regex
> Compile regular expressions using named groups to ES5.
See our website [@babel/plugin-transform-named-capturing-groups-regex](https://babeljs.io/docs/en/next/babel-plugin-transform-named-capturing-groups-regex.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-named-capturing-groups-regex
```
or using yarn:
```sh
yarn add @babel/plugin-transform-named-capturing-groups-regex --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _helperCreateRegexpFeaturesPlugin = require("@babel/helper-create-regexp-features-plugin");
function _default(core, options) {
const {
runtime = true
} = options;
if (typeof runtime !== "boolean") {
throw new Error("The 'runtime' option must be boolean");
}
return (0, _helperCreateRegexpFeaturesPlugin.createRegExpFeaturePlugin)({
name: "transform-named-capturing-groups-regex",
feature: "namedCaptureGroups",
options: {
runtime
}
});
}
\ No newline at end of file
{
"name": "@babel/plugin-transform-named-capturing-groups-regex",
"version": "7.7.0",
"description": "Compile regular expressions using named groups to ES5.",
"homepage": "https://babeljs.io/",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"babel-plugin",
"regex",
"regexp",
"regular expressions"
],
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-named-capturing-groups-regex"
},
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
"@babel/helper-create-regexp-features-plugin": "^7.7.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/helper-plugin-test-runner": "^7.0.0",
"core-js": "^3.2.1",
"core-js-pure": "^3.2.1"
},
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
}
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @babel/plugin-transform-new-target
> Transforms new.target meta property
See our website [@babel/plugin-transform-new-target](https://babeljs.io/docs/en/next/babel-plugin-transform-new-target.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-new-target
```
or using yarn:
```sh
yarn add @babel/plugin-transform-new-target --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
return data;
};
return data;
}
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
var _default = (0, _helperPluginUtils().declare)(api => {
api.assertVersion(7);
return {
name: "transform-new-target",
visitor: {
MetaProperty(path) {
const meta = path.get("meta");
const property = path.get("property");
const {
scope
} = path;
if (meta.isIdentifier({
name: "new"
}) && property.isIdentifier({
name: "target"
})) {
const func = path.findParent(path => {
if (path.isClass()) return true;
if (path.isFunction() && !path.isArrowFunctionExpression()) {
if (path.isClassMethod({
kind: "constructor"
})) {
return false;
}
return true;
}
return false;
});
if (!func) {
throw path.buildCodeFrameError("new.target must be under a (non-arrow) function or a class.");
}
const {
node
} = func;
if (!node.id) {
if (func.isMethod()) {
path.replaceWith(scope.buildUndefinedNode());
return;
}
node.id = scope.generateUidIdentifier("target");
}
const constructor = _core().types.memberExpression(_core().types.thisExpression(), _core().types.identifier("constructor"));
if (func.isClass()) {
path.replaceWith(constructor);
return;
}
path.replaceWith(_core().types.conditionalExpression(_core().types.binaryExpression("instanceof", _core().types.thisExpression(), _core().types.cloneNode(node.id)), constructor, scope.buildUndefinedNode()));
}
}
}
};
});
exports.default = _default;
\ No newline at end of file
{
"name": "@babel/plugin-transform-new-target",
"version": "7.4.4",
"description": "Transforms new.target meta property",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/helper-plugin-test-runner": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-transform-arrow-functions": "^7.0.0"
},
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba"
}
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @babel/plugin-transform-object-super
> Compile ES2015 object super to ES5
See our website [@babel/plugin-transform-object-super](https://babeljs.io/docs/en/next/babel-plugin-transform-object-super.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-object-super
```
or using yarn:
```sh
yarn add @babel/plugin-transform-object-super --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
return data;
};
return data;
}
function _helperReplaceSupers() {
const data = _interopRequireDefault(require("@babel/helper-replace-supers"));
_helperReplaceSupers = function () {
return data;
};
return data;
}
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function replacePropertySuper(path, getObjectRef, file) {
const replaceSupers = new (_helperReplaceSupers().default)({
getObjectRef: getObjectRef,
methodPath: path,
file: file
});
replaceSupers.replace();
}
var _default = (0, _helperPluginUtils().declare)(api => {
api.assertVersion(7);
return {
name: "transform-object-super",
visitor: {
ObjectExpression(path, state) {
let objectRef;
const getObjectRef = () => objectRef = objectRef || path.scope.generateUidIdentifier("obj");
path.get("properties").forEach(propPath => {
if (!propPath.isMethod()) return;
replacePropertySuper(propPath, getObjectRef, state);
});
if (objectRef) {
path.scope.push({
id: _core().types.cloneNode(objectRef)
});
path.replaceWith(_core().types.assignmentExpression("=", _core().types.cloneNode(objectRef), path.node));
}
}
}
};
});
exports.default = _default;
\ No newline at end of file
{
"name": "@babel/plugin-transform-object-super",
"version": "7.5.5",
"description": "Compile ES2015 object super to ES5",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/helper-replace-supers": "^7.5.5"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/helper-plugin-test-runner": "^7.0.0"
},
"gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43"
}
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment