Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsDoc - how to specify array length

In jsDoc I can specify my array parameters and members like this:

/**
 * @constructor
 * @param {Array.<string>} myArray
 */
function someFunction( myArray ){

    this.firstArray = myArray;

    /** @member {Array.<float>} */
    this.secondArray = [];

}

Is there also a way to specify the length, or minLength and maxLength of these arrays?

like image 938
Wilt Avatar asked Apr 01 '14 12:04

Wilt


1 Answers

I think you're asking whether you can include the minimum/maximum length in the type expressions (for example, Array.<string>).

In short, the answer is no. You'll need to document the minimum/maximum length in the description of each array.

like image 99
Jeff Williams Avatar answered Nov 03 '22 07:11

Jeff Williams