Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,3 @@
src
test
node_modules

View File

@@ -0,0 +1,5 @@
# babel-helper-hoist-variables
## Usage
TODO

View File

@@ -0,0 +1,71 @@
"use strict";
exports.__esModule = true;
var _getIterator2 = require("babel-runtime/core-js/get-iterator");
var _getIterator3 = _interopRequireDefault(_getIterator2);
exports.default = function (path, emit) {
var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "var";
path.traverse(visitor, { kind: kind, emit: emit });
};
var _babelTypes = require("babel-types");
var t = _interopRequireWildcard(_babelTypes);
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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var visitor = {
Scope: function Scope(path, state) {
if (state.kind === "let") path.skip();
},
Function: function Function(path) {
path.skip();
},
VariableDeclaration: function VariableDeclaration(path, state) {
if (state.kind && path.node.kind !== state.kind) return;
var nodes = [];
var declarations = path.get("declarations");
var firstId = void 0;
for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var declar = _ref;
firstId = declar.node.id;
if (declar.node.init) {
nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init)));
}
for (var name in declar.getBindingIdentifiers()) {
state.emit(t.identifier(name), name);
}
}
if (path.parentPath.isFor({ left: path.node })) {
path.replaceWith(firstId);
} else {
path.replaceWithMultiple(nodes);
}
}
};
module.exports = exports["default"];

View File

@@ -0,0 +1,44 @@
{
"_args": [
[
"babel-helper-hoist-variables@6.24.1",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "babel-helper-hoist-variables@6.24.1",
"_id": "babel-helper-hoist-variables@6.24.1",
"_inBundle": false,
"_integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
"_location": "/react-scripts/babel-helper-hoist-variables",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "babel-helper-hoist-variables@6.24.1",
"name": "babel-helper-hoist-variables",
"escapedName": "babel-helper-hoist-variables",
"rawSpec": "6.24.1",
"saveSpec": null,
"fetchSpec": "6.24.1"
},
"_requiredBy": [
"/react-scripts/babel-helper-call-delegate",
"/react-scripts/babel-plugin-transform-es2015-modules-systemjs"
],
"_resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
"_spec": "6.24.1",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"dependencies": {
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1"
},
"description": "Helper function to hoist variables",
"license": "MIT",
"main": "lib/index.js",
"name": "babel-helper-hoist-variables",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables"
},
"version": "6.24.1"
}