diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/babel-plugin-transform-es2015-arrow-functions | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/babel-plugin-transform-es2015-arrow-functions')
4 files changed, 0 insertions, 181 deletions
diff --git a/node_modules/babel-plugin-transform-es2015-arrow-functions/.npmignore b/node_modules/babel-plugin-transform-es2015-arrow-functions/.npmignore deleted file mode 100644 index 3185290..0000000 --- a/node_modules/babel-plugin-transform-es2015-arrow-functions/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -*.log -src -test diff --git a/node_modules/babel-plugin-transform-es2015-arrow-functions/README.md b/node_modules/babel-plugin-transform-es2015-arrow-functions/README.md deleted file mode 100644 index 6e1b8f3..0000000 --- a/node_modules/babel-plugin-transform-es2015-arrow-functions/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# babel-plugin-transform-es2015-arrow-functions - -> Compile ES2015 arrow functions to ES5 - -## Example - -**In** - -```javascript -var a = () => {}; -var a = (b) => b; - -const double = [1,2,3].map((num) => num * 2); -console.log(double); // [2,4,6] - -var bob = { - _name: "Bob", - _friends: ["Sally", "Tom"], - printFriends() { - this._friends.forEach(f => - console.log(this._name + " knows " + f)); - } -}; -console.log(bob.printFriends()); -``` - -**Out** - -```javascript -var a = function a() {}; -var a = function a(b) { - return b; -}; - -var double = [1, 2, 3].map(function (num) { - return num * 2; -}); -console.log(double); // [2,4,6] - -var bob = { - _name: "Bob", - _friends: ["Sally", "Tom"], - printFriends: function printFriends() { - var _this = this; - - this._friends.forEach(function (f) { - return console.log(_this._name + " knows " + f); - }); - } -}; -console.log(bob.printFriends()); -``` - -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&lineWrap=true&presets=es2015%2Ces2015-loose&experimental=false&loose=false&spec=false&code=var%20a%20%3D%20()%20%3D%3E%20%7B%7D%3B%0Avar%20a%20%3D%20(b)%20%3D%3E%20b%3B%0A%0Aconst%20double%20%3D%20%5B1%2C2%2C3%5D.map((num)%20%3D%3E%20num%20*%202)%3B%0Aconsole.log(double)%3B%20%2F%2F%20%5B2%2C4%2C6%5D%0A%0Avar%20bob%20%3D%20%7B%0A%20%20_name%3A%20%22Bob%22%2C%0A%20%20_friends%3A%20%5B%22Sally%22%2C%20%22Tom%22%5D%2C%0A%20%20printFriends()%20%7B%0A%20%20%20%20this._friends.forEach(f%20%3D%3E%0A%20%20%20%20%20%20console.log(this._name%20%2B%20%22%20knows%20%22%20%2B%20f))%3B%0A%20%20%7D%0A%7D%3B%0Aconsole.log(bob.printFriends())%3B&playground=true) - -## Installation - -```sh -npm install --save-dev babel-plugin-transform-es2015-arrow-functions -``` - -## Usage - -### Via `.babelrc` (Recommended) - -**.babelrc** - -```js -// without options -{ - "plugins": ["transform-es2015-arrow-functions"] -} - -// with options -{ - "plugins": [ - ["transform-es2015-arrow-functions", { "spec": true }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins transform-es2015-arrow-functions script.js -``` - -### Via Node API - -```javascript -require("babel-core").transform("code", { - plugins: ["transform-es2015-arrow-functions"] -}); -``` - -## Options - -* `spec` - This option wraps the generated function in `.bind(this)` and keeps uses of `this` inside the function as-is, instead of using a renamed `this`. It also adds a runtime check to ensure the functions are not instantiated. diff --git a/node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js b/node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js deleted file mode 100644 index 8cef2fd..0000000 --- a/node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -exports.__esModule = true; - -exports.default = function (_ref) { - var t = _ref.types; - - return { - visitor: { - ArrowFunctionExpression: function ArrowFunctionExpression(path, state) { - if (state.opts.spec) { - var node = path.node; - - if (node.shadow) return; - - node.shadow = { this: false }; - node.type = "FunctionExpression"; - - var boundThis = t.thisExpression(); - boundThis._forceShadow = path; - - path.ensureBlock(); - path.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(state.addHelper("newArrowCheck"), [t.thisExpression(), boundThis]))); - - path.replaceWith(t.callExpression(t.memberExpression(node, t.identifier("bind")), [t.thisExpression()])); - } else { - path.arrowFunctionToShadowed(); - } - } - } - }; -}; - -module.exports = exports["default"];
\ No newline at end of file diff --git a/node_modules/babel-plugin-transform-es2015-arrow-functions/package.json b/node_modules/babel-plugin-transform-es2015-arrow-functions/package.json deleted file mode 100644 index 2a52913..0000000 --- a/node_modules/babel-plugin-transform-es2015-arrow-functions/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "_from": "babel-plugin-transform-es2015-arrow-functions@^6.22.0", - "_id": "babel-plugin-transform-es2015-arrow-functions@6.22.0", - "_inBundle": false, - "_integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "_location": "/babel-plugin-transform-es2015-arrow-functions", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "babel-plugin-transform-es2015-arrow-functions@^6.22.0", - "name": "babel-plugin-transform-es2015-arrow-functions", - "escapedName": "babel-plugin-transform-es2015-arrow-functions", - "rawSpec": "^6.22.0", - "saveSpec": null, - "fetchSpec": "^6.22.0" - }, - "_requiredBy": [ - "/babel-preset-es2015" - ], - "_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "_shasum": "452692cb711d5f79dc7f85e440ce41b9f244d221", - "_spec": "babel-plugin-transform-es2015-arrow-functions@^6.22.0", - "_where": "/home/pruss/Dev/3-minute-website/node_modules/babel-preset-es2015", - "bundleDependencies": false, - "dependencies": { - "babel-runtime": "^6.22.0" - }, - "deprecated": false, - "description": "Compile ES2015 arrow functions to ES5", - "devDependencies": { - "babel-helper-plugin-test-runner": "^6.22.0" - }, - "keywords": [ - "babel-plugin" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "babel-plugin-transform-es2015-arrow-functions", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-arrow-functions" - }, - "version": "6.22.0" -} |