forked from daren.hsu/line_push
update
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
> Babel plugin to ensure function declarations at the block level are block scoped
|
||||
|
||||
See our website [@babel/plugin-transform-block-scoped-functions](https://babeljs.io/docs/en/next/babel-plugin-transform-block-scoped-functions.html) for more information.
|
||||
See our website [@babel/plugin-transform-block-scoped-functions](https://babeljs.io/docs/en/babel-plugin-transform-block-scoped-functions) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
+4
-6
@@ -12,12 +12,10 @@ var _core = require("@babel/core");
|
||||
var _default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
function statementList(key, path) {
|
||||
const paths = path.get(key);
|
||||
|
||||
function transformStatementList(paths) {
|
||||
for (const path of paths) {
|
||||
const func = path.node;
|
||||
if (!path.isFunctionDeclaration()) continue;
|
||||
const func = path.node;
|
||||
|
||||
const declar = _core.types.variableDeclaration("let", [_core.types.variableDeclarator(func.id, _core.types.toExpression(func))]);
|
||||
|
||||
@@ -42,11 +40,11 @@ var _default = (0, _helperPluginUtils.declare)(api => {
|
||||
return;
|
||||
}
|
||||
|
||||
statementList("body", path);
|
||||
transformStatementList(path.get("body"));
|
||||
},
|
||||
|
||||
SwitchCase(path) {
|
||||
statementList("consequent", path);
|
||||
transformStatementList(path.get("consequent"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+25
-18
@@ -1,51 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/plugin-transform-block-scoped-functions@7.10.4",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"@babel/plugin-transform-block-scoped-functions@7.18.6",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/plugin-transform-block-scoped-functions@7.10.4",
|
||||
"_id": "@babel/plugin-transform-block-scoped-functions@7.10.4",
|
||||
"_from": "@babel/plugin-transform-block-scoped-functions@7.18.6",
|
||||
"_id": "@babel/plugin-transform-block-scoped-functions@7.18.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==",
|
||||
"_integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==",
|
||||
"_location": "/@babel/plugin-transform-block-scoped-functions",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/plugin-transform-block-scoped-functions@7.10.4",
|
||||
"raw": "@babel/plugin-transform-block-scoped-functions@7.18.6",
|
||||
"name": "@babel/plugin-transform-block-scoped-functions",
|
||||
"escapedName": "@babel%2fplugin-transform-block-scoped-functions",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.4",
|
||||
"rawSpec": "7.18.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.4"
|
||||
"fetchSpec": "7.18.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/preset-env"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz",
|
||||
"_spec": "7.10.4",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz",
|
||||
"_spec": "7.18.6",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "The Babel Team",
|
||||
"url": "https://babel.dev/team"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.10.4"
|
||||
"@babel/helper-plugin-utils": "^7.18.6"
|
||||
},
|
||||
"description": "Babel plugin to ensure function declarations at the block level are block scoped",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.4",
|
||||
"@babel/helper-plugin-test-runner": "^7.10.4"
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.18.6"
|
||||
},
|
||||
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-block-scoped-functions",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"main": "./lib/index.js",
|
||||
"name": "@babel/plugin-transform-block-scoped-functions",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
@@ -58,5 +64,6 @@
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-block-scoped-functions"
|
||||
},
|
||||
"version": "7.10.4"
|
||||
"type": "commonjs",
|
||||
"version": "7.18.6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user