aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-block-scoped-functions
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/plugin-transform-block-scoped-functions')
-rw-r--r--node_modules/@babel/plugin-transform-block-scoped-functions/README.md60
-rw-r--r--node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js81
-rw-r--r--node_modules/@babel/plugin-transform-block-scoped-functions/package.json21
3 files changed, 0 insertions, 162 deletions
diff --git a/node_modules/@babel/plugin-transform-block-scoped-functions/README.md b/node_modules/@babel/plugin-transform-block-scoped-functions/README.md
deleted file mode 100644
index 95985cf6..00000000
--- a/node_modules/@babel/plugin-transform-block-scoped-functions/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# @babel/plugin-transform-block-scoped-functions
-
-> Babel plugin to ensure function declarations at the block level are block scoped.
-
-## Examples
-
-**In**
-
-```javascript
-{
- function name (n) {
- return n;
- }
-}
-
-name("Steve");
-```
-
-**Out**
-
-```javascript
-{
- let name = function (n) {
- return n;
- };
-}
-name("Steve");
-```
-
-## Installation
-
-```sh
-npm install --save-dev @babel/plugin-transform-block-scoped-functions
-```
-
-## Usage
-
-### Via `.babelrc` (Recommended)
-
-**.babelrc**
-
-```json
-{
- "plugins": ["@babel/plugin-transform-block-scoped-functions"]
-}
-```
-
-### Via CLI
-
-```sh
-babel --plugins @babel/plugin-transform-block-scoped-functions script.js
-```
-
-### Via Node API
-
-```javascript
-require("@babel/core").transform("code", {
- plugins: ["@babel/plugin-transform-block-scoped-functions"]
-});
-```
diff --git a/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js b/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js
deleted file mode 100644
index 970590bb..00000000
--- a/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js
+++ /dev/null
@@ -1,81 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-
-function _helperPluginUtils() {
- const data = require("@babel/helper-plugin-utils");
-
- _helperPluginUtils = function _helperPluginUtils() {
- return data;
- };
-
- return data;
-}
-
-function _core() {
- const data = require("@babel/core");
-
- _core = function _core() {
- return data;
- };
-
- return data;
-}
-
-var _default = (0, _helperPluginUtils().declare)(api => {
- api.assertVersion(7);
-
- function statementList(key, path) {
- const paths = path.get(key);
-
- for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
-
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
-
- const path = _ref;
- const func = path.node;
- if (!path.isFunctionDeclaration()) continue;
-
- const declar = _core().types.variableDeclaration("let", [_core().types.variableDeclarator(func.id, _core().types.toExpression(func))]);
-
- declar._blockHoist = 2;
- func.id = null;
- path.replaceWith(declar);
- }
- }
-
- return {
- visitor: {
- BlockStatement(path) {
- const node = path.node,
- parent = path.parent;
-
- if (_core().types.isFunction(parent, {
- body: node
- }) || _core().types.isExportDeclaration(parent)) {
- return;
- }
-
- statementList("body", path);
- },
-
- SwitchCase(path) {
- statementList("consequent", path);
- }
-
- }
- };
-});
-
-exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/plugin-transform-block-scoped-functions/package.json b/node_modules/@babel/plugin-transform-block-scoped-functions/package.json
deleted file mode 100644
index 6e310e79..00000000
--- a/node_modules/@babel/plugin-transform-block-scoped-functions/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "@babel/plugin-transform-block-scoped-functions",
- "version": "7.0.0-beta.47",
- "description": "Babel plugin to ensure function declarations at the block level are block scoped",
- "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions",
- "license": "MIT",
- "main": "lib/index.js",
- "keywords": [
- "babel-plugin"
- ],
- "dependencies": {
- "@babel/helper-plugin-utils": "7.0.0-beta.47"
- },
- "peerDependencies": {
- "@babel/core": "7.0.0-beta.47"
- },
- "devDependencies": {
- "@babel/core": "7.0.0-beta.47",
- "@babel/helper-plugin-test-runner": "7.0.0-beta.47"
- }
-}