настройка webpack
This commit is contained in:
22
node_modules/@babel/plugin-proposal-optional-chaining/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/plugin-proposal-optional-chaining/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
node_modules/@babel/plugin-proposal-optional-chaining/README.md
generated
vendored
Normal file
19
node_modules/@babel/plugin-proposal-optional-chaining/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/plugin-proposal-optional-chaining
|
||||
|
||||
> Transform optional chaining operators into a series of nil checks
|
||||
|
||||
See our website [@babel/plugin-proposal-optional-chaining](https://babeljs.io/docs/en/next/babel-plugin-proposal-optional-chaining.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-proposal-optional-chaining
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-proposal-optional-chaining --dev
|
||||
```
|
||||
150
node_modules/@babel/plugin-proposal-optional-chaining/lib/index.js
generated
vendored
Normal file
150
node_modules/@babel/plugin-proposal-optional-chaining/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,150 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _pluginSyntaxOptionalChaining = _interopRequireDefault(require("@babel/plugin-syntax-optional-chaining"));
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
||||
api.assertVersion(7);
|
||||
const {
|
||||
loose = false
|
||||
} = options;
|
||||
|
||||
function isSimpleMemberExpression(expression) {
|
||||
return _core.types.isIdentifier(expression) || _core.types.isSuper(expression) || _core.types.isMemberExpression(expression) && !expression.computed && isSimpleMemberExpression(expression.object);
|
||||
}
|
||||
|
||||
return {
|
||||
name: "proposal-optional-chaining",
|
||||
inherits: _pluginSyntaxOptionalChaining.default,
|
||||
visitor: {
|
||||
"OptionalCallExpression|OptionalMemberExpression"(path) {
|
||||
const {
|
||||
scope
|
||||
} = path;
|
||||
let maybeParenthesized = path;
|
||||
const parentPath = path.findParent(p => {
|
||||
if (!p.isParenthesizedExpression()) return true;
|
||||
maybeParenthesized = p;
|
||||
});
|
||||
let isDeleteOperation = false;
|
||||
const parentIsCall = parentPath.isCallExpression({
|
||||
callee: maybeParenthesized.node
|
||||
}) && path.isOptionalMemberExpression();
|
||||
const optionals = [];
|
||||
let optionalPath = path;
|
||||
|
||||
while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression() || optionalPath.isParenthesizedExpression() || optionalPath.isTSNonNullExpression()) {
|
||||
const {
|
||||
node
|
||||
} = optionalPath;
|
||||
|
||||
if (node.optional) {
|
||||
optionals.push(node);
|
||||
}
|
||||
|
||||
if (optionalPath.isOptionalMemberExpression()) {
|
||||
optionalPath.node.type = "MemberExpression";
|
||||
optionalPath = optionalPath.get("object");
|
||||
} else if (optionalPath.isOptionalCallExpression()) {
|
||||
optionalPath.node.type = "CallExpression";
|
||||
optionalPath = optionalPath.get("callee");
|
||||
} else {
|
||||
optionalPath = optionalPath.get("expression");
|
||||
}
|
||||
}
|
||||
|
||||
let replacementPath = path;
|
||||
|
||||
if (parentPath.isUnaryExpression({
|
||||
operator: "delete"
|
||||
})) {
|
||||
replacementPath = parentPath;
|
||||
isDeleteOperation = true;
|
||||
}
|
||||
|
||||
for (let i = optionals.length - 1; i >= 0; i--) {
|
||||
const node = optionals[i];
|
||||
|
||||
const isCall = _core.types.isCallExpression(node);
|
||||
|
||||
const replaceKey = isCall ? "callee" : "object";
|
||||
const chain = node[replaceKey];
|
||||
let ref;
|
||||
let check;
|
||||
|
||||
if (loose && isCall && isSimpleMemberExpression(chain)) {
|
||||
check = ref = chain;
|
||||
} else {
|
||||
ref = scope.maybeGenerateMemoised(chain);
|
||||
|
||||
if (ref) {
|
||||
check = _core.types.assignmentExpression("=", _core.types.cloneNode(ref), chain);
|
||||
node[replaceKey] = ref;
|
||||
} else {
|
||||
check = ref = chain;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCall && _core.types.isMemberExpression(chain)) {
|
||||
if (loose && isSimpleMemberExpression(chain)) {
|
||||
node.callee = chain;
|
||||
} else {
|
||||
const {
|
||||
object
|
||||
} = chain;
|
||||
let context = scope.maybeGenerateMemoised(object);
|
||||
|
||||
if (context) {
|
||||
chain.object = _core.types.assignmentExpression("=", context, object);
|
||||
} else if (_core.types.isSuper(object)) {
|
||||
context = _core.types.thisExpression();
|
||||
} else {
|
||||
context = object;
|
||||
}
|
||||
|
||||
node.arguments.unshift(_core.types.cloneNode(context));
|
||||
node.callee = _core.types.memberExpression(node.callee, _core.types.identifier("call"));
|
||||
}
|
||||
}
|
||||
|
||||
let replacement = replacementPath.node;
|
||||
|
||||
if (i === 0 && parentIsCall) {
|
||||
var _baseRef;
|
||||
|
||||
const {
|
||||
object
|
||||
} = replacement;
|
||||
let baseRef;
|
||||
|
||||
if (!loose || !isSimpleMemberExpression(object)) {
|
||||
baseRef = scope.maybeGenerateMemoised(object);
|
||||
|
||||
if (baseRef) {
|
||||
replacement.object = _core.types.assignmentExpression("=", baseRef, object);
|
||||
}
|
||||
}
|
||||
|
||||
replacement = _core.types.callExpression(_core.types.memberExpression(replacement, _core.types.identifier("bind")), [_core.types.cloneNode((_baseRef = baseRef) != null ? _baseRef : object)]);
|
||||
}
|
||||
|
||||
replacementPath.replaceWith(_core.types.conditionalExpression(loose ? _core.types.binaryExpression("==", _core.types.cloneNode(check), _core.types.nullLiteral()) : _core.types.logicalExpression("||", _core.types.binaryExpression("===", _core.types.cloneNode(check), _core.types.nullLiteral()), _core.types.binaryExpression("===", _core.types.cloneNode(ref), scope.buildUndefinedNode())), isDeleteOperation ? _core.types.booleanLiteral(true) : scope.buildUndefinedNode(), replacement));
|
||||
replacementPath = replacementPath.get("alternate");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
||||
61
node_modules/@babel/plugin-proposal-optional-chaining/package.json
generated
vendored
Normal file
61
node_modules/@babel/plugin-proposal-optional-chaining/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "@babel/plugin-proposal-optional-chaining@^7.10.4",
|
||||
"_id": "@babel/plugin-proposal-optional-chaining@7.10.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZIhQIEeavTgouyMSdZRap4VPPHqJJ3NEs2cuHs5p0erH+iz6khB0qfgU8g7UuJkG88+fBMy23ZiU+nuHvekJeQ==",
|
||||
"_location": "/@babel/plugin-proposal-optional-chaining",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@babel/plugin-proposal-optional-chaining@^7.10.4",
|
||||
"name": "@babel/plugin-proposal-optional-chaining",
|
||||
"escapedName": "@babel%2fplugin-proposal-optional-chaining",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "^7.10.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^7.10.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/preset-env"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.4.tgz",
|
||||
"_shasum": "750f1255e930a1f82d8cdde45031f81a0d0adff7",
|
||||
"_spec": "@babel/plugin-proposal-optional-chaining@^7.10.4",
|
||||
"_where": "/Users/alinavigdorova/dev/storage-service-ui/node_modules/@babel/preset-env",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.10.4",
|
||||
"@babel/plugin-syntax-optional-chaining": "^7.8.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Transform optional chaining operators into a series of nil checks",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.4",
|
||||
"@babel/helper-plugin-test-runner": "^7.10.4",
|
||||
"@babel/plugin-transform-block-scoping": "^7.10.4"
|
||||
},
|
||||
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/plugin-proposal-optional-chaining",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-proposal-optional-chaining"
|
||||
},
|
||||
"version": "7.10.4"
|
||||
}
|
||||
Reference in New Issue
Block a user