mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-02 12:00:03 +02:00
use terser and clean-css directly
create a sourcemap as well by default
This commit is contained in:
5
node_modules/acorn-globals/README.md
generated
vendored
5
node_modules/acorn-globals/README.md
generated
vendored
@@ -2,6 +2,8 @@
|
||||
|
||||
Detect global variables in JavaScript using acorn
|
||||
|
||||
[Get supported acorn-globals with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-acorn_globals?utm_source=npm-acorn-globals&utm_medium=referral&utm_campaign=readme)
|
||||
|
||||
[](https://travis-ci.org/ForbesLindesay/acorn-globals)
|
||||
[](https://david-dm.org/ForbesLindesay/acorn-globals)
|
||||
[](https://www.npmjs.org/package/acorn-globals)
|
||||
@@ -70,6 +72,9 @@ $ node example/detect.js
|
||||
{ name: 'xyz', nodes: [ [Object] ] } ]
|
||||
```
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## License
|
||||
|
||||
|
26
node_modules/acorn-globals/index.js
generated
vendored
26
node_modules/acorn-globals/index.js
generated
vendored
@@ -46,7 +46,7 @@ function findGlobals(source, options) {
|
||||
}
|
||||
var declareFunction = function (node) {
|
||||
var fn = node;
|
||||
fn.locals = fn.locals || {};
|
||||
fn.locals = fn.locals || Object.create(null);
|
||||
node.params.forEach(function (node) {
|
||||
declarePattern(node, fn);
|
||||
});
|
||||
@@ -54,6 +54,12 @@ function findGlobals(source, options) {
|
||||
fn.locals[node.id.name] = true;
|
||||
}
|
||||
};
|
||||
var declareClass = function (node) {
|
||||
node.locals = node.locals || Object.create(null);
|
||||
if (node.id) {
|
||||
node.locals[node.id.name] = true;
|
||||
}
|
||||
};
|
||||
var declarePattern = function (node, parent) {
|
||||
switch (node.type) {
|
||||
case 'Identifier':
|
||||
@@ -81,7 +87,7 @@ function findGlobals(source, options) {
|
||||
}
|
||||
};
|
||||
var declareModuleSpecifier = function (node, parents) {
|
||||
ast.locals = ast.locals || {};
|
||||
ast.locals = ast.locals || Object.create(null);
|
||||
ast.locals[node.local.name] = true;
|
||||
};
|
||||
walk.ancestor(ast, {
|
||||
@@ -92,7 +98,7 @@ function findGlobals(source, options) {
|
||||
parent = parents[i];
|
||||
}
|
||||
}
|
||||
parent.locals = parent.locals || {};
|
||||
parent.locals = parent.locals || Object.create(null);
|
||||
node.declarations.forEach(function (declaration) {
|
||||
declarePattern(declaration.id, parent);
|
||||
});
|
||||
@@ -104,7 +110,7 @@ function findGlobals(source, options) {
|
||||
parent = parents[i];
|
||||
}
|
||||
}
|
||||
parent.locals = parent.locals || {};
|
||||
parent.locals = parent.locals || Object.create(null);
|
||||
if (node.id) {
|
||||
parent.locals[node.id.name] = true;
|
||||
}
|
||||
@@ -114,19 +120,21 @@ function findGlobals(source, options) {
|
||||
'ClassDeclaration': function (node, parents) {
|
||||
var parent = null;
|
||||
for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
|
||||
if (isScope(parents[i])) {
|
||||
if (isBlockScope(parents[i])) {
|
||||
parent = parents[i];
|
||||
}
|
||||
}
|
||||
parent.locals = parent.locals || {};
|
||||
parent.locals = parent.locals || Object.create(null);
|
||||
if (node.id) {
|
||||
parent.locals[node.id.name] = true;
|
||||
}
|
||||
declareClass(node);
|
||||
},
|
||||
'Class': declareClass,
|
||||
'TryStatement': function (node) {
|
||||
if (node.handler === null) return;
|
||||
node.handler.locals = node.handler.locals || {};
|
||||
node.handler.locals[node.handler.param.name] = true;
|
||||
node.handler.locals = node.handler.locals || Object.create(null);
|
||||
declarePattern(node.handler.param, node.handler);
|
||||
},
|
||||
'ImportDefaultSpecifier': declareModuleSpecifier,
|
||||
'ImportSpecifier': declareModuleSpecifier,
|
||||
@@ -159,7 +167,7 @@ function findGlobals(source, options) {
|
||||
globals.push(node);
|
||||
}
|
||||
});
|
||||
var groupedGlobals = {};
|
||||
var groupedGlobals = Object.create(null);
|
||||
globals.forEach(function (node) {
|
||||
var name = node.type === 'ThisExpression' ? 'this' : node.name;
|
||||
groupedGlobals[name] = (groupedGlobals[name] || []);
|
||||
|
10
node_modules/acorn-globals/package.json
generated
vendored
10
node_modules/acorn-globals/package.json
generated
vendored
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "acorn-globals@^4.3.0",
|
||||
"_id": "acorn-globals@4.3.1",
|
||||
"_id": "acorn-globals@4.3.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-gJSiKY8dBIjV/0jagZIFBdVMtfQyA5QHCvAT48H2q8REQoW8Fs5AOjqBql1LgSXgrMWdevcE+8cdZ33NtVbIBA==",
|
||||
"_integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==",
|
||||
"_location": "/acorn-globals",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"_requiredBy": [
|
||||
"/jsdom"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.1.tgz",
|
||||
"_shasum": "deb149c59276657ebd40ba2ba849ddd529763ccf",
|
||||
"_resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz",
|
||||
"_shasum": "9fa1926addc11c97308c4e66d7add0d40c3272e7",
|
||||
"_spec": "acorn-globals@^4.3.0",
|
||||
"_where": "F:\\projects\\p\\minifyfromhtml\\node_modules\\jsdom",
|
||||
"author": {
|
||||
@@ -62,5 +62,5 @@
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"version": "4.3.1"
|
||||
"version": "4.3.4"
|
||||
}
|
||||
|
Reference in New Issue
Block a user