Newer
Older
alert / js / node_modules / @babel / helper-get-function-arity / lib / index.js
@Réz István Réz István on 18 Nov 2021 392 bytes first commit
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;

var t = require("@babel/types");

function _default(node) {
  const params = node.params;

  for (let i = 0; i < params.length; i++) {
    const param = params[i];

    if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
      return i;
    }
  }

  return params.length;
}