flow like the river

This commit is contained in:
root 2025-11-07 00:06:12 +01:00
commit 013fe673f3
42435 changed files with 5764238 additions and 0 deletions

View file

@ -0,0 +1,4 @@
node_modules
*.log
src
test

View file

@ -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"]
});
```

View file

@ -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"];

View file

@ -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"
}
}