1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-02 12:00:03 +02:00
Files
minifyfromhtml/node_modules/@babel/helper-get-function-arity
2018-05-05 15:35:25 +02:00
..
2018-05-05 15:35:25 +02:00
2018-05-05 15:35:25 +02:00
2018-05-05 15:35:25 +02:00

@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

Usage

import getFunctionArity from "@babel/helper-get-function-arity";

function wrap(state, method, id, scope) {
  // ...
  if (!t.isFunction(method)) {
    return false;
  }

  const argumentsLength = getFunctionArity(method);

  // ...
}