initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# @babel/helper-remap-async-to-generator
> Helper function to remap async functions to generators
See our website [@babel/helper-remap-async-to-generator](https://babeljs.io/docs/en/next/babel-helper-remap-async-to-generator.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/helper-remap-async-to-generator
```
or using yarn:
```sh
yarn add @babel/helper-remap-async-to-generator --dev
```

View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _helperWrapFunction() {
const data = _interopRequireDefault(require("@babel/helper-wrap-function"));
_helperWrapFunction = function () {
return data;
};
return data;
}
function _helperAnnotateAsPure() {
const data = _interopRequireDefault(require("@babel/helper-annotate-as-pure"));
_helperAnnotateAsPure = function () {
return data;
};
return data;
}
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const awaitVisitor = {
Function(path) {
path.skip();
},
AwaitExpression(path, {
wrapAwait
}) {
const argument = path.get("argument");
if (path.parentPath.isYieldExpression()) {
path.replaceWith(argument.node);
return;
}
path.replaceWith(t().yieldExpression(wrapAwait ? t().callExpression(t().cloneNode(wrapAwait), [argument.node]) : argument.node));
}
};
function _default(path, helpers) {
path.traverse(awaitVisitor, {
wrapAwait: helpers.wrapAwait
});
const isIIFE = checkIsIIFE(path);
path.node.async = false;
path.node.generator = true;
(0, _helperWrapFunction().default)(path, t().cloneNode(helpers.wrapAsync));
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();
if (!isProperty && !isIIFE && path.isExpression()) {
(0, _helperAnnotateAsPure().default)(path);
}
function checkIsIIFE(path) {
if (path.parentPath.isCallExpression({
callee: path.node
})) {
return true;
}
const {
parentPath
} = path;
if (parentPath.isMemberExpression() && t().isIdentifier(parentPath.node.property, {
name: "bind"
})) {
const {
parentPath: bindCall
} = parentPath;
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t().isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({
callee: bindCall.node
});
}
return false;
}
}

View File

@@ -0,0 +1,86 @@
{
"_args": [
[
"@babel/helper-remap-async-to-generator@^7.0.0-beta",
"/home/bernhard/freifunk-app/node_modules/metro"
]
],
"_from": "@babel/helper-remap-async-to-generator@>=7.0.0-beta <8.0.0",
"_id": "@babel/helper-remap-async-to-generator@7.0.0-beta.54",
"_inCache": true,
"_installable": true,
"_location": "/@babel/helper-remap-async-to-generator",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/helper-remap-async-to-generator_7.0.0-beta.54_1531764030290_0.7782408185279373"
},
"_npmUser": {
"email": "hi@henryzoo.com",
"name": "hzoo"
},
"_phantomChildren": {},
"_requested": {
"name": "@babel/helper-remap-async-to-generator",
"raw": "@babel/helper-remap-async-to-generator@^7.0.0-beta",
"rawSpec": "^7.0.0-beta",
"scope": "@babel",
"spec": ">=7.0.0-beta <8.0.0",
"type": "range"
},
"_requiredBy": [
"/metro"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.54.tgz",
"_shasum": "39a50052aadd74d40c73b7c58eb963b90fac56d3",
"_shrinkwrap": null,
"_spec": "@babel/helper-remap-async-to-generator@^7.0.0-beta",
"_where": "/home/bernhard/freifunk-app/node_modules/metro",
"dependencies": {
"@babel/helper-annotate-as-pure": "7.0.0-beta.54",
"@babel/helper-wrap-function": "7.0.0-beta.54",
"@babel/template": "7.0.0-beta.54",
"@babel/traverse": "7.0.0-beta.54",
"@babel/types": "7.0.0-beta.54"
},
"description": "Helper function to remap async functions to generators",
"devDependencies": {},
"directories": {},
"dist": {
"fileCount": 5,
"shasum": "39a50052aadd74d40c73b7c58eb963b90fac56d3",
"tarball": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.54.tgz",
"unpackedSize": 3749
},
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
"name": "danez",
"email": "daniel@tschinder.de"
},
{
"name": "existentialism",
"email": "bng412@gmail.com"
},
{
"name": "hzoo",
"email": "hi@henryzoo.com"
},
{
"name": "loganfsmyth",
"email": "loganfsmyth@gmail.com"
},
{
"name": "xtuc",
"email": "contact@xtuc.fr"
}
],
"name": "@babel/helper-remap-async-to-generator",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator"
},
"version": "7.0.0-beta.54"
}