1
0
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:
s2
2018-05-05 13:54:07 +02:00
parent 48c1138518
commit ff6e20677d
3738 changed files with 215920 additions and 0 deletions

40
node_modules/babel-plugin-minify-infinity/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
module.exports = function ({
types: t
}) {
const INFINITY = t.binaryExpression("/", t.numericLiteral(1), t.numericLiteral(0));
return {
name: "minify-infinity",
visitor: {
// Infinity -> 1 / 0
Identifier(path) {
if (path.node.name !== "Infinity") {
return;
} // It's a referenced identifier
if (path.scope.getBinding("Infinity")) {
return;
}
if (path.parentPath.isObjectProperty({
key: path.node
})) {
return;
}
if (path.parentPath.isMemberExpression()) {
return;
}
if (path.isLVal() && !path.parentPath.isExpressionStatement()) {
return;
}
path.replaceWith(INFINITY);
}
}
};
};