How to use babel-helper-get-function-arity - 1 common examples

To help you get started, we’ve selected a few babel-helper-get-function-arity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github babel / babel / packages / babel-plugin-transform-es2015-parameters / src / default.js View on Github external
defNode = buildDefaultParamAssign({
          VARIABLE_NAME: left,
          DEFAULT_VALUE: right
        });
      }
      defNode._blockHoist = node.params.length - i;
      body.push(defNode);
    }

    // check if an index exceeds the functions arity
    function exceedsLastNonDefault(i) {
      return i + 1 > lastNonDefaultParam;
    }

    //
    let lastNonDefaultParam = getFunctionArity(node);

    //
    let params = path.get("params");
    for (let i = 0; i < params.length; i++) {
      let param = params[i];

      if (!param.isAssignmentPattern()) {
        if (!param.isIdentifier()) {
          param.traverse(iifeVisitor, state);
        }

        continue;
      }

      let left  = param.get("left");
      let right = param.get("right");

babel-helper-get-function-arity

Helper function to get function arity

MIT
Latest version published 7 years ago

Package Health Score

88 / 100
Full package analysis

Popular babel-helper-get-function-arity functions

Similar packages