From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- .../plugin-syntax-throw-expressions/README.md | 42 ++++++++++++++++++++++ .../plugin-syntax-throw-expressions/lib/index.js | 28 +++++++++++++++ .../plugin-syntax-throw-expressions/package.json | 20 +++++++++++ 3 files changed, 90 insertions(+) create mode 100644 node_modules/@babel/plugin-syntax-throw-expressions/README.md create mode 100644 node_modules/@babel/plugin-syntax-throw-expressions/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-throw-expressions/package.json (limited to 'node_modules/@babel/plugin-syntax-throw-expressions') diff --git a/node_modules/@babel/plugin-syntax-throw-expressions/README.md b/node_modules/@babel/plugin-syntax-throw-expressions/README.md new file mode 100644 index 00000000..9aa7f878 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-throw-expressions/README.md @@ -0,0 +1,42 @@ +# @babel/plugin-syntax-throw-expressions + +Allow parsing of Throw Expressions: + +```js +function test(param = throw new Error('required!')) { + const test = param === true || throw new Error('Falsey!'); +} +``` + + +## Installation + +```sh +npm install --save-dev @babel/plugin-syntax-throw-expressions +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["@babel/plugin-syntax-throw-expressions"] +} +``` + +### Via CLI + +```sh +babel --plugins @babel/plugin-syntax-throw-expressions script.js +``` + +### Via Node API + +```javascript +require("@babel/core").transform("code", { + plugins: ["@babel/plugin-syntax-throw-expressions"] +}); +``` diff --git a/node_modules/@babel/plugin-syntax-throw-expressions/lib/index.js b/node_modules/@babel/plugin-syntax-throw-expressions/lib/index.js new file mode 100644 index 00000000..1daff7a6 --- /dev/null +++ b/node_modules/@babel/plugin-syntax-throw-expressions/lib/index.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _helperPluginUtils() { + const data = require("@babel/helper-plugin-utils"); + + _helperPluginUtils = function _helperPluginUtils() { + return data; + }; + + return data; +} + +var _default = (0, _helperPluginUtils().declare)(api => { + api.assertVersion(7); + return { + manipulateOptions(opts, parserOpts) { + parserOpts.plugins.push("throwExpressions"); + } + + }; +}); + +exports.default = _default; \ No newline at end of file diff --git a/node_modules/@babel/plugin-syntax-throw-expressions/package.json b/node_modules/@babel/plugin-syntax-throw-expressions/package.json new file mode 100644 index 00000000..e5ba5ada --- /dev/null +++ b/node_modules/@babel/plugin-syntax-throw-expressions/package.json @@ -0,0 +1,20 @@ +{ + "name": "@babel/plugin-syntax-throw-expressions", + "version": "7.0.0-beta.47", + "description": "Allow parsing of Throw Expressions", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-throw-expressions", + "license": "MIT", + "main": "lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.47" + }, + "peerDependencies": { + "@babel/core": "7.0.0-beta.47" + }, + "devDependencies": { + "@babel/core": "7.0.0-beta.47" + } +} -- cgit v1.2.3