diff options
Diffstat (limited to 'node_modules/babel-plugin-transform-es2015-function-name')
4 files changed, 120 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 0000000..3185290 --- /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 0000000..815acc5 --- /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 0000000..0fd5c66 --- /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 0000000..b1c7043 --- /dev/null +++ b/node_modules/babel-plugin-transform-es2015-function-name/package.json @@ -0,0 +1,47 @@ +{ + "_from": "babel-plugin-transform-es2015-function-name@^6.24.1", + "_id": "babel-plugin-transform-es2015-function-name@6.24.1", + "_inBundle": false, + "_integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "_location": "/babel-plugin-transform-es2015-function-name", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "babel-plugin-transform-es2015-function-name@^6.24.1", + "name": "babel-plugin-transform-es2015-function-name", + "escapedName": "babel-plugin-transform-es2015-function-name", + "rawSpec": "^6.24.1", + "saveSpec": null, + "fetchSpec": "^6.24.1" + }, + "_requiredBy": [ + "/babel-preset-es2015" + ], + "_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "_shasum": "834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b", + "_spec": "babel-plugin-transform-es2015-function-name@^6.24.1", + "_where": "/home/pruss/Dev/3-minute-website/node_modules/babel-preset-es2015", + "bundleDependencies": false, + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + }, + "deprecated": false, + "description": "Apply ES2015 function.name semantics to all functions", + "devDependencies": { + "babel-helper-plugin-test-runner": "^6.24.1" + }, + "keywords": [ + "babel-plugin" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "babel-plugin-transform-es2015-function-name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-function-name" + }, + "version": "6.24.1" +} |