style Dashboard

This commit is contained in:
Lieu Le
2019-09-13 11:27:52 +07:00
parent 558fb07261
commit 07322c9084
17151 changed files with 1686347 additions and 103 deletions

View File

@@ -0,0 +1,4 @@
node_modules
*.log
src
test

View File

@@ -0,0 +1,60 @@
# babel-plugin-transform-async-to-generator
> Turn async functions into ES2015 generators
## Example
**In**
```javascript
async function foo() {
await bar();
}
```
**Out**
```javascript
var _asyncToGenerator = function (fn) {
...
};
var foo = _asyncToGenerator(function* () {
yield bar();
});
```
## Installation
```sh
npm install --save-dev babel-plugin-transform-async-to-generator
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["transform-async-to-generator"]
}
```
### Via CLI
```sh
babel --plugins transform-async-to-generator script.js
```
### Via Node API
```javascript
require("babel-core").transform("code", {
plugins: ["transform-async-to-generator"]
});
```
## References
* [Proposal: Async Functions for ECMAScript](https://github.com/tc39/ecmascript-asyncawait)

View File

@@ -0,0 +1,27 @@
"use strict";
exports.__esModule = true;
exports.default = function () {
return {
inherits: require("babel-plugin-syntax-async-functions"),
visitor: {
Function: function Function(path, state) {
if (!path.node.async || path.node.generator) return;
(0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, {
wrapAsync: state.addHelper("asyncToGenerator")
});
}
}
};
};
var _babelHelperRemapAsyncToGenerator = require("babel-helper-remap-async-to-generator");
var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports["default"];

View File

@@ -0,0 +1,51 @@
{
"_args": [
[
"babel-plugin-transform-async-to-generator@6.24.1",
"/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome"
]
],
"_from": "babel-plugin-transform-async-to-generator@6.24.1",
"_id": "babel-plugin-transform-async-to-generator@6.24.1",
"_inBundle": false,
"_integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
"_location": "/babel-plugin-transform-async-to-generator",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "babel-plugin-transform-async-to-generator@6.24.1",
"name": "babel-plugin-transform-async-to-generator",
"escapedName": "babel-plugin-transform-async-to-generator",
"rawSpec": "6.24.1",
"saveSpec": null,
"fetchSpec": "6.24.1"
},
"_requiredBy": [
"/babel-preset-env",
"/babel-preset-stage-3"
],
"_resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
"_spec": "6.24.1",
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/latehome",
"dependencies": {
"babel-helper-remap-async-to-generator": "^6.24.1",
"babel-plugin-syntax-async-functions": "^6.8.0",
"babel-runtime": "^6.22.0"
},
"description": "Turn async functions into ES2015 generators",
"devDependencies": {
"babel-helper-plugin-test-runner": "^6.24.1"
},
"keywords": [
"babel-plugin"
],
"license": "MIT",
"main": "lib/index.js",
"name": "babel-plugin-transform-async-to-generator",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator"
},
"version": "6.24.1"
}