diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/babel-plugin-transform-es2015-function-name | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/babel-plugin-transform-es2015-function-name')
4 files changed, 92 insertions, 0 deletions
diff --git a/node_modules/babel-plugin-transform-es2015-function-name/.npmignore b/node_modules/babel-plugin-transform-es2015-function-name/.npmignore new file mode 100644 index 000000000..31852902b --- /dev/null +++ b/node_modules/babel-plugin-transform-es2015-function-name/.npmignore @@ -0,0 +1,4 @@ +node_modules +*.log +src +test diff --git a/node_modules/babel-plugin-transform-es2015-function-name/README.md b/node_modules/babel-plugin-transform-es2015-function-name/README.md new file mode 100644 index 000000000..815acc5be --- /dev/null +++ b/node_modules/babel-plugin-transform-es2015-function-name/README.md @@ -0,0 +1,35 @@ +# babel-plugin-transform-es2015-function-name + +> Apply ES2015 function.name semantics to all functions + +## Installation + +```sh +npm install --save-dev babel-plugin-transform-es2015-function-name +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["transform-es2015-function-name"] +} +``` + +### Via CLI + +```sh +babel --plugins transform-es2015-function-name script.js +``` + +### Via Node API + +```javascript +require("babel-core").transform("code", { + plugins: ["transform-es2015-function-name"] +}); +``` diff --git a/node_modules/babel-plugin-transform-es2015-function-name/lib/index.js b/node_modules/babel-plugin-transform-es2015-function-name/lib/index.js new file mode 100644 index 000000000..0fd5c6604 --- /dev/null +++ b/node_modules/babel-plugin-transform-es2015-function-name/lib/index.js @@ -0,0 +1,34 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function () { + return { + visitor: { + FunctionExpression: { + exit: function exit(path) { + if (path.key !== "value" && !path.parentPath.isObjectProperty()) { + var replacement = (0, _babelHelperFunctionName2.default)(path); + if (replacement) path.replaceWith(replacement); + } + } + }, + + ObjectProperty: function ObjectProperty(path) { + var value = path.get("value"); + if (value.isFunction()) { + var newNode = (0, _babelHelperFunctionName2.default)(value); + if (newNode) value.replaceWith(newNode); + } + } + } + }; +}; + +var _babelHelperFunctionName = require("babel-helper-function-name"); + +var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports["default"];
\ No newline at end of file diff --git a/node_modules/babel-plugin-transform-es2015-function-name/package.json b/node_modules/babel-plugin-transform-es2015-function-name/package.json new file mode 100644 index 000000000..4d96d97f4 --- /dev/null +++ b/node_modules/babel-plugin-transform-es2015-function-name/package.json @@ -0,0 +1,19 @@ +{ + "name": "babel-plugin-transform-es2015-function-name", + "version": "6.24.1", + "description": "Apply ES2015 function.name semantics to all functions", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-function-name", + "license": "MIT", + "main": "lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-types": "^6.24.1", + "babel-runtime": "^6.22.0" + }, + "devDependencies": { + "babel-helper-plugin-test-runner": "^6.24.1" + } +} |