index.js 695 B

12345678910111213141516171819202122
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = function (node) {
  4. var params = node.params;
  5. for (var i = 0; i < params.length; i++) {
  6. var param = params[i];
  7. if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
  8. return i;
  9. }
  10. }
  11. return params.length;
  12. };
  13. var _babelTypes = require("babel-types");
  14. var t = _interopRequireWildcard(_babelTypes);
  15. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  16. module.exports = exports["default"];