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-exponentiation-operator | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/babel-plugin-transform-exponentiation-operator')
4 files changed, 113 insertions, 0 deletions
diff --git a/node_modules/babel-plugin-transform-exponentiation-operator/.npmignore b/node_modules/babel-plugin-transform-exponentiation-operator/.npmignore new file mode 100644 index 000000000..31852902b --- /dev/null +++ b/node_modules/babel-plugin-transform-exponentiation-operator/.npmignore @@ -0,0 +1,4 @@ +node_modules +*.log +src +test diff --git a/node_modules/babel-plugin-transform-exponentiation-operator/README.md b/node_modules/babel-plugin-transform-exponentiation-operator/README.md new file mode 100644 index 000000000..274dfe841 --- /dev/null +++ b/node_modules/babel-plugin-transform-exponentiation-operator/README.md @@ -0,0 +1,63 @@ +# babel-plugin-transform-exponentiation-operator + +> Compile exponentiation operator to ES5 + +## Example + +```js +// x ** y + +let squared = 2 ** 2; +// same as: 2 * 2 + +let cubed = 2 ** 3; +// same as: 2 * 2 * 2 + + +// x **= y + +let a = 2; +a **= 2; +// same as: a = a * a; + +let b = 3; +b **= 3; +// same as: b = b * b * b; +``` + +## Installation + +```sh +npm install --save-dev babel-plugin-transform-exponentiation-operator +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["transform-exponentiation-operator"] +} +``` + +### Via CLI + +```sh +babel --plugins transform-exponentiation-operator script.js +``` + +### Via Node API + +```javascript +require("babel-core").transform("code", { + plugins: ["transform-exponentiation-operator"] +}); +``` + +## References + +* [Proposal: Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) +* [Spec: Exponential Operator](https://rwaldron.github.io/exponentiation-operator/) diff --git a/node_modules/babel-plugin-transform-exponentiation-operator/lib/index.js b/node_modules/babel-plugin-transform-exponentiation-operator/lib/index.js new file mode 100644 index 000000000..ef6387d92 --- /dev/null +++ b/node_modules/babel-plugin-transform-exponentiation-operator/lib/index.js @@ -0,0 +1,27 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (_ref) { + var t = _ref.types; + + return { + inherits: require("babel-plugin-syntax-exponentiation-operator"), + + visitor: (0, _babelHelperBuilderBinaryAssignmentOperatorVisitor2.default)({ + operator: "**", + + build: function build(left, right) { + return t.callExpression(t.memberExpression(t.identifier("Math"), t.identifier("pow")), [left, right]); + } + }) + }; +}; + +var _babelHelperBuilderBinaryAssignmentOperatorVisitor = require("babel-helper-builder-binary-assignment-operator-visitor"); + +var _babelHelperBuilderBinaryAssignmentOperatorVisitor2 = _interopRequireDefault(_babelHelperBuilderBinaryAssignmentOperatorVisitor); + +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-exponentiation-operator/package.json b/node_modules/babel-plugin-transform-exponentiation-operator/package.json new file mode 100644 index 000000000..8055d3811 --- /dev/null +++ b/node_modules/babel-plugin-transform-exponentiation-operator/package.json @@ -0,0 +1,19 @@ +{ + "name": "babel-plugin-transform-exponentiation-operator", + "version": "6.24.1", + "description": "Compile exponentiation operator to ES5", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator", + "license": "MIT", + "main": "lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-runtime": "^6.22.0" + }, + "devDependencies": { + "babel-helper-plugin-test-runner": "^6.24.1" + } +} |