Lawsun d230cfbce0 first commit hace 1 año
..
lib d230cfbce0 first commit hace 1 año
README.md d230cfbce0 first commit hace 1 año
package.json d230cfbce0 first commit hace 1 año

README.md

@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);

  // ...
}