Sha256: 919dbf37c9294d96b2f517d7cce83d916616b446b3947082c06b39c9658ccf9f

Contents?: true

Size: 445 Bytes

Versions: 7

Compression:

Stored size: 445 Bytes

Contents

"use strict";

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

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

const {
  isAssignmentPattern,
  isRestElement
} = _t;

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

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

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

  return params.length;
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.15.2 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.18.4 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.18.1 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.14.0 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/helper-get-function-arity/lib/index.js