Update with working working version (#12)
* Fix workflow * Trigger * [auto] Update compiled version * [auto] Commit modules * Push Windows changes * Fix * [auto] Update compiled version * Try removing cwd * [auto] Update compiled version * Try with path module * [auto] Update compiled version * Fix path * [auto] Update compiled version * Use raw path * [auto] Update compiled version * Other path * [auto] Update compiled version * Avoid @action/exec * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * Try with shelljs * [auto] Update compiled version * Fix my stupidity * Copy scripts to local dir * [auto] Update compiled version * Still use path * [auto] Update compiled version * Delete entrypoint.sh * [auto] Update compiled version * Make file executable * [auto] Update compiled version * Try using bash * [auto] Update compiled version
This commit is contained in:
47
node_modules/babel-plugin-minify-infinity/README.md
generated
vendored
Normal file
47
node_modules/babel-plugin-minify-infinity/README.md
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# babel-plugin-minify-infinity
|
||||
|
||||
## Example
|
||||
|
||||
**In**
|
||||
|
||||
```javascript
|
||||
Infinity;
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```javascript
|
||||
1 / 0;
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install babel-plugin-minify-infinity --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["minify-infinity"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins minify-infinity script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["minify-infinity"]
|
||||
});
|
||||
```
|
||||
44
node_modules/babel-plugin-minify-infinity/lib/index.js
generated
vendored
Normal file
44
node_modules/babel-plugin-minify-infinity/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"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;
|
||||
}
|
||||
|
||||
const bindingIds = path.parentPath.getBindingIdentifierPaths();
|
||||
|
||||
if (bindingIds["Infinity"] === path && // ObjectProperty is common for ObjectExpression and ObjectPattern and only
|
||||
// one of them is a Binding, the other is simply a reference
|
||||
!path.parentPath.parentPath.isObjectExpression()) {
|
||||
return;
|
||||
}
|
||||
|
||||
path.replaceWith(INFINITY);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
50
node_modules/babel-plugin-minify-infinity/package.json
generated
vendored
Normal file
50
node_modules/babel-plugin-minify-infinity/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"babel-plugin-minify-infinity@0.4.3",
|
||||
"/home/runner/work/add-and-commit/add-and-commit"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "babel-plugin-minify-infinity@0.4.3",
|
||||
"_id": "babel-plugin-minify-infinity@0.4.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=",
|
||||
"_location": "/babel-plugin-minify-infinity",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "babel-plugin-minify-infinity@0.4.3",
|
||||
"name": "babel-plugin-minify-infinity",
|
||||
"escapedName": "babel-plugin-minify-infinity",
|
||||
"rawSpec": "0.4.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.4.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-preset-minify"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz",
|
||||
"_spec": "0.4.3",
|
||||
"_where": "/home/runner/work/add-and-commit/add-and-commit",
|
||||
"author": {
|
||||
"name": "amasad"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/minify/issues"
|
||||
},
|
||||
"description": "## Example",
|
||||
"homepage": "https://github.com/babel/minify#readme",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "babel-plugin-minify-infinity",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/minify/tree/master/packages/babel-plugin-minify-infinity"
|
||||
},
|
||||
"version": "0.4.3"
|
||||
}
|
||||
Reference in New Issue
Block a user