index.js 392 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = _default;
  6. var t = require("@babel/types");
  7. function _default(node) {
  8. const params = node.params;
  9. for (let i = 0; i < params.length; i++) {
  10. const param = params[i];
  11. if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
  12. return i;
  13. }
  14. }
  15. return params.length;
  16. }