mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
add some babel stuff
This commit is contained in:
21
node_modules/@babel/helper-get-function-arity/README.md
generated
vendored
Normal file
21
node_modules/@babel/helper-get-function-arity/README.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# @babel/helper-get-function-arity
|
||||
|
||||
Function that returns the number of arguments that a function takes.
|
||||
* Examples of what is considered an argument can be found at [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length)
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
import getFunctionArity from "@babel/helper-get-function-arity";
|
||||
|
||||
function wrap(state, method, id, scope) {
|
||||
// ...
|
||||
if (!t.isFunction(method)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const argumentsLength = getFunctionArity(method);
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
32
node_modules/@babel/helper-get-function-arity/lib/index.js
generated
vendored
Normal file
32
node_modules/@babel/helper-get-function-arity/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function t() {
|
||||
var data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function t() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _default(node) {
|
||||
var params = node.params;
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var param = params[i];
|
||||
|
||||
if (t().isAssignmentPattern(param) || t().isRestElement(param)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return params.length;
|
||||
}
|
40
node_modules/@babel/helper-get-function-arity/package.json
generated
vendored
Normal file
40
node_modules/@babel/helper-get-function-arity/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"_from": "@babel/helper-get-function-arity@7.0.0-beta.46",
|
||||
"_id": "@babel/helper-get-function-arity@7.0.0-beta.46",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-dPrTb7QHVx44xJLjUl3LGAc13iS7hdXdO0fiOxdRN1suIS91yGGgeuwiQBlrw5SxbFchYtwenhlKbqHdVfGyVA==",
|
||||
"_location": "/@babel/helper-get-function-arity",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-get-function-arity@7.0.0-beta.46",
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"escapedName": "@babel%2fhelper-get-function-arity",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.0.0-beta.46",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.0.0-beta.46"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-function-name"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.46.tgz",
|
||||
"_shasum": "7161bfe449b4183dbe25d1fe5579338b7429e5f2",
|
||||
"_spec": "@babel/helper-get-function-arity@7.0.0-beta.46",
|
||||
"_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/@babel/helper-function-name",
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.46"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Helper function to get function arity",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity"
|
||||
},
|
||||
"version": "7.0.0-beta.46"
|
||||
}
|
Reference in New Issue
Block a user