How to get @borrows tag working in JSDoc

It was hard for me to get the @borrows tag working in JSDoc. I am trying to get documentation from one function, and we are it as documentation for the second function. But I can't seem to get a simple work example!

/**
 * This is the description for funcA
 */
var funcA = function() {};

/**
 * @borrows funcA as funcB
 */
var funcB = function() {};

I expected this to output the documentation for both functions with the same precision. However, only funcA has only a description.

I would appreciate help, I feel like I don’t understand some basic JSBin concepts. Please tell me that I am new to JSDoc and there seems to be no detailed documentation.

+4
source share
1 answer

The tag @borrowsdoes not seem to work directly with the symbol, but only indirectly. For example, I had:

/** does amazing things */
function origFunc = function() {};

/**
 * @borrows origFunc as exportedFunc
 */
exports.exportedFunc = origFunc;

, , .

, @borrows . ( @borrows "util" / , .)

, :

/** does amazing things */
function origFunc = function() {};

/**
 * @borrows origFunc as exportedFunc
 */
exports = {
  exportedFunc: origFunc,
}

@borrows. (, , .)

+2

All Articles