@@ -8,6 +8,7 @@ var TypeBuilder = require('jsdoctypeparser').Builder;
88TypeBuilder . ENABLE_EXCEPTIONS = true ;
99
1010module . exports = {
11+
1112 /**
1213 * @param {string } commentNode
1314 * @returns {DocComment }
@@ -57,18 +58,18 @@ function DocComment(value, loc) {
5758 } ) ;
5859
5960 /**
60- * @param {function } fn
61- * @chainable
61+ * @param {function(this: DocComment, DocTag): DocComment } fn
62+ * @returns { DocComment }
6263 */
6364 this . iterate = function forEachTag ( fn ) {
64- this . tags . forEach ( fn ) ;
65+ this . tags . forEach ( fn , this ) ;
6566 return this ;
6667 } ;
6768
6869 /**
69- * @param {string|array } types
70- * @param {function } fn
71- * @chainable
70+ * @param {string|Array.<string> } types
71+ * @param {function(this: DocComment, DocTag): DocComment } fn
72+ * @returns { DocComment }
7273 */
7374 this . iterateByType = function iterateByTypes ( types , fn ) {
7475 var k = 0 ;
@@ -85,7 +86,7 @@ function DocComment(value, loc) {
8586
8687/**
8788 * Simple jsdoc tag object
88- * @param {Object } tag
89+ * @param {Object } tag object from comment parser, fields: tag, line, value, name, type, description
8990 * @param {DocLocation } loc
9091 * @constructor
9192 */
@@ -159,8 +160,8 @@ function DocType(type, loc) {
159160/**
160161 * DocLocation
161162 * @constructor
162- * @param {Number } line
163- * @param {Number } column
163+ * @param {number } line
164+ * @param {number } column
164165 * @param {(Object|DocLocation) } [rel]
165166 */
166167function DocLocation ( line , column , rel ) {
@@ -173,9 +174,9 @@ function DocLocation(line, column, rel) {
173174
174175/**
175176 * Shift location by line and column
176- * @param {Number |Object } line
177- * @param {Number } [column]
178- * @return {DocLocation }
177+ * @param {number |Object } line
178+ * @param {number } [column]
179+ * @returns {DocLocation }
179180 */
180181DocLocation . prototype . shift = function ( line , column ) {
181182 if ( typeof line === 'object' ) {
@@ -187,7 +188,7 @@ DocLocation.prototype.shift = function(line, column) {
187188
188189/**
189190 * Comment parsing helper
190- * @param {String } comment
191+ * @param {string } comment
191192 * @returns {Object }
192193 * @private
193194 */
@@ -232,7 +233,7 @@ function _parseComment(comment) {
232233/**
233234 * Additional name parsing logic for our purposes
234235 * @param {string } str - unparsed name thing
235- * @return {Object }
236+ * @returns {Object }
236237 */
237238function _parseNameAgain ( str ) { // (?:\s+(\S+))?
238239 var out = { } ;
@@ -296,8 +297,8 @@ function _parseNameAgain(str) { // (?:\s+(\S+))?
296297}
297298
298299/**
299- * @param {String } typeString
300- * @return {?Array.<SimplifiedType> } - parsed jsdoctype string as array
300+ * @param {string } typeString
301+ * @returns {?Array.<SimplifiedType> } - parsed jsdoctype string as array
301302 */
302303function _parseDocType ( typeString ) {
303304 var parser = new TypeParser ( ) ;
@@ -313,6 +314,11 @@ function _parseDocType(typeString) {
313314 return node ;
314315}
315316
317+ /**
318+ * @param {EsprimaNode } node
319+ * @param {Function } cb
320+ * @returns {Array }
321+ */
316322function _iterateDocTypes ( node , cb ) {
317323 var res ;
318324
@@ -413,7 +419,7 @@ function _iterateDocTypes(node, cb) {
413419/**
414420 * Converts AST jsDoc node to simple object
415421 * @param {Object } node
416- * @returns {!( SimplifiedType[]) }
422+ * @returns {!Array.< SimplifiedType> }
417423 * @link https://github.com/Kuniwak/jsdoctypeparser
418424 */
419425function _simplifyType ( node ) {
@@ -426,7 +432,7 @@ function _simplifyType(node) {
426432 return res ;
427433}
428434
429- var jsPrimitives = 'String Number Boolean Object Array Date Null Undefined Function Array RegExp'
435+ var jsPrimitives = 'string number boolean null undefined Object Function Array Date RegExp'
430436 . toLowerCase ( ) . split ( ' ' ) ;
431437
432438/**
0 commit comments