mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 12:20:04 +02:00
add some packages
This commit is contained in:
7
node_modules/babel-helper-remove-or-void/README.md
generated
vendored
Normal file
7
node_modules/babel-helper-remove-or-void/README.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# babel-helper-remove-or-void
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install babel-helper-remove-or-void
|
||||
```
|
28
node_modules/babel-helper-remove-or-void/lib/index.js
generated
vendored
Normal file
28
node_modules/babel-helper-remove-or-void/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (t) {
|
||||
// If we can't remove the expression we'll just replace it with an empty statement.
|
||||
function removeOrVoid(path) {
|
||||
// If we are working with the expression of an expression statement we want to deal
|
||||
// with the expression statement instead.
|
||||
if (path.parentPath.isExpressionStatement({
|
||||
expression: path.node
|
||||
})) {
|
||||
path = path.parentPath;
|
||||
} // If we are working with a variable declarator and there is only one then
|
||||
// we need to look at the parent.
|
||||
|
||||
|
||||
if (path.isVariableDeclarator() && path.parent.declarations[0] === path.node && path.parent.declarations.length === 1) {
|
||||
path = path.parentPath;
|
||||
}
|
||||
|
||||
if (!path.inList && path.scope.path.type !== "ForStatement") {
|
||||
path.replaceWith(t.emptyStatement());
|
||||
} else {
|
||||
path.remove();
|
||||
}
|
||||
}
|
||||
|
||||
return removeOrVoid;
|
||||
};
|
46
node_modules/babel-helper-remove-or-void/package.json
generated
vendored
Normal file
46
node_modules/babel-helper-remove-or-void/package.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"_from": "babel-helper-remove-or-void@^0.4.1",
|
||||
"_id": "babel-helper-remove-or-void@0.4.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-rdWwiBeFOVESpw8PHCWRebFSQmo=",
|
||||
"_location": "/babel-helper-remove-or-void",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "babel-helper-remove-or-void@^0.4.1",
|
||||
"name": "babel-helper-remove-or-void",
|
||||
"escapedName": "babel-helper-remove-or-void",
|
||||
"rawSpec": "^0.4.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.4.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-plugin-minify-dead-code-elimination"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.1.tgz",
|
||||
"_shasum": "add5b0881785395112a70f0f1c259179b152426a",
|
||||
"_spec": "babel-helper-remove-or-void@^0.4.1",
|
||||
"_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/babel-plugin-minify-dead-code-elimination",
|
||||
"author": {
|
||||
"name": "amasad"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/minify/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "## Installation",
|
||||
"homepage": "https://github.com/babel/minify#readme",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "babel-helper-remove-or-void",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/minify/tree/master/packages/babel-helper-remove-or-void"
|
||||
},
|
||||
"version": "0.4.1"
|
||||
}
|
Reference in New Issue
Block a user