mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-14 16:54:07 +07:00
Improve code quality and write tests
This commit is contained in:
22
node_modules/@babel/helper-hoist-variables/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/helper-hoist-variables/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/helper-hoist-variables/README.md
generated
vendored
Normal file
19
node_modules/@babel/helper-hoist-variables/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/helper-hoist-variables
|
||||
|
||||
> Helper function to hoist variables
|
||||
|
||||
See our website [@babel/helper-hoist-variables](https://babeljs.io/docs/en/next/babel-helper-hoist-variables.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-hoist-variables
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-hoist-variables --dev
|
||||
```
|
63
node_modules/@babel/helper-hoist-variables/lib/index.js
generated
vendored
Normal file
63
node_modules/@babel/helper-hoist-variables/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
const visitor = {
|
||||
Scope(path, state) {
|
||||
if (state.kind === "let") path.skip();
|
||||
},
|
||||
|
||||
Function(path) {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
VariableDeclaration(path, state) {
|
||||
if (state.kind && path.node.kind !== state.kind) return;
|
||||
const nodes = [];
|
||||
const declarations = path.get("declarations");
|
||||
let firstId;
|
||||
|
||||
for (const declar of declarations) {
|
||||
firstId = declar.node.id;
|
||||
|
||||
if (declar.node.init) {
|
||||
nodes.push(t().expressionStatement(t().assignmentExpression("=", declar.node.id, declar.node.init)));
|
||||
}
|
||||
|
||||
for (const name of Object.keys(declar.getBindingIdentifiers())) {
|
||||
state.emit(t().identifier(name), name, declar.node.init !== null);
|
||||
}
|
||||
}
|
||||
|
||||
if (path.parentPath.isFor({
|
||||
left: path.node
|
||||
})) {
|
||||
path.replaceWith(firstId);
|
||||
} else {
|
||||
path.replaceWithMultiple(nodes);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function _default(path, emit, kind = "var") {
|
||||
path.traverse(visitor, {
|
||||
kind,
|
||||
emit
|
||||
});
|
||||
}
|
48
node_modules/@babel/helper-hoist-variables/package.json
generated
vendored
Normal file
48
node_modules/@babel/helper-hoist-variables/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-hoist-variables@7.4.4",
|
||||
"E:\\python\\setup-php"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-hoist-variables@7.4.4",
|
||||
"_id": "@babel/helper-hoist-variables@7.4.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==",
|
||||
"_location": "/@babel/helper-hoist-variables",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-hoist-variables@7.4.4",
|
||||
"name": "@babel/helper-hoist-variables",
|
||||
"escapedName": "@babel%2fhelper-hoist-variables",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.4.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.4.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-call-delegate",
|
||||
"/@babel/plugin-transform-modules-systemjs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz",
|
||||
"_spec": "7.4.4",
|
||||
"_where": "E:\\python\\setup-php",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.4.4"
|
||||
},
|
||||
"description": "Helper function to hoist variables",
|
||||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-hoist-variables",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables"
|
||||
},
|
||||
"version": "7.4.4"
|
||||
}
|
Reference in New Issue
Block a user