Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
445 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = _default;
|
---|
| 7 |
|
---|
| 8 | var _t = require("@babel/types");
|
---|
| 9 |
|
---|
| 10 | const {
|
---|
| 11 | isAssignmentPattern,
|
---|
| 12 | isRestElement
|
---|
| 13 | } = _t;
|
---|
| 14 |
|
---|
| 15 | function _default(node) {
|
---|
| 16 | const params = node.params;
|
---|
| 17 |
|
---|
| 18 | for (let i = 0; i < params.length; i++) {
|
---|
| 19 | const param = params[i];
|
---|
| 20 |
|
---|
| 21 | if (isAssignmentPattern(param) || isRestElement(param)) {
|
---|
| 22 | return i;
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | return params.length;
|
---|
| 27 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.